diff --git a/bookstack-helm/templates/backupscript.yaml b/bookstack-helm/templates/backupscript.yaml index 4cc5afc..82c38ff 100644 --- a/bookstack-helm/templates/backupscript.yaml +++ b/bookstack-helm/templates/backupscript.yaml @@ -17,7 +17,7 @@ data: restore.sh: | echo "Checking if restore is needed" echo "Restore file is: $RESTORE_S3_URL" - if [ ! -n "$RESTORE_S3_URL" ] && [ "$RESTORE_S3_URL" != "skip" ]; then + if [ "$RESTORE_S3_URL" != "skip" ]; then echo "Restoring from $RESTORE_S3_URL" apk add aws-cli aws s3 cp "$RESTORE_S3_URL" /tmp/restore.tgz diff --git a/bookstack-helm/templates/restore.yaml b/bookstack-helm/templates/restore.yaml deleted file mode 100644 index 5904c85..0000000 --- a/bookstack-helm/templates/restore.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: restorejob - namespace: {{ .Values.meshwiki_app_namespace }} -spec: - template: - spec: - containers: - - name: restorejob - image: "{{ .Values.db_image.repository }}:{{ .Values.db_image.tag }}" - imagePullPolicy: {{ .Values.db_image.pullPolicy }} - command: - - /bin/bash - - /restore.sh - volumeMounts: - - name: backup-script - mountPath: /restore.sh - subPath: restore.sh - readOnly: true - env: - - name: DB_HOST - valueFrom: - configMapKeyRef: - name: wikiconfig - key: DB_HOST - - name: DB_USER - valueFrom: - secretKeyRef: - name: wiki-secrets - key: db-username - - name: DB_PASS - valueFrom: - secretKeyRef: - name: wiki-secrets - key: db-password - - name: RESTORE_S3_URL - valueFrom: - secretKeyRef: - name: wiki-secrets - key: restore-s3-url - - name: AWS_ACCESS_KEY_ID - valueFrom: - secretKeyRef: - name: wiki-secrets - key: access-key-id - - name: AWS_SECRET_ACCESS_KEY - valueFrom: - secretKeyRef: - name: wiki-secrets - key: secret-access-key - restartPolicy: OnFailure - volumes: - - name: backup-script - configMap: - name: backup-script - items: - - key: restore.sh - path: restore.sh