From 60ecd34036061b57d424289a1b5c9146b5a1bb9a Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Mon, 17 Apr 2023 10:17:02 +0530 Subject: [PATCH] fix: Fixed bash script for moving backups (#5) --- charts/neo4j-backup/Chart.yaml | 2 +- charts/neo4j-backup/templates/deployment.yaml | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/charts/neo4j-backup/Chart.yaml b/charts/neo4j-backup/Chart.yaml index 50a48dd..6ee82a8 100644 --- a/charts/neo4j-backup/Chart.yaml +++ b/charts/neo4j-backup/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: neo4j-backup description: Backup Neo4J databases to GCS type: application -version: 0.1.4 +version: 0.1.5 appVersion: "1.0.0" diff --git a/charts/neo4j-backup/templates/deployment.yaml b/charts/neo4j-backup/templates/deployment.yaml index 5135657..dd04b59 100644 --- a/charts/neo4j-backup/templates/deployment.yaml +++ b/charts/neo4j-backup/templates/deployment.yaml @@ -21,7 +21,9 @@ spec: fi old_IFS=$IFS IFS=',' + echo {{ .Values.databases }} db_names="{{- join "," .Values.databases }}" + echo db_names for db in $db_names; do neo4j-admin database backup \ --from={{ required "Backup service must be provided" .Values.service }} \ @@ -46,7 +48,10 @@ spec: - | echo {{ required "Service Account is required" .Values.serviceAccount }} | base64 -d > /etc/gcloud/service-account.json gcsfuse {{ required "Bucket name must be provided" .Values.bucket }} /mnt/gcs - mv /mnt/backups/* /mnt/gcs/ + if [ ! -d "/mnt/gcs/{{ .Values.name }}" ]; then + mkdir /mnt/gcs/{{ .Values.name }} + fi + mv /mnt/backups/{{ .Values.name }}/* /mnt/gcs/{{ .Values.name }} volumeMounts: - name: gcs-creds-volume mountPath: /etc/gcloud