From 0338bd5d13c6fd92889357bc0ca7af094b7fafab Mon Sep 17 00:00:00 2001 From: sonicaj Date: Tue, 12 Sep 2023 18:36:35 +0000 Subject: [PATCH] Publish new changes in catalog --- .../templates/backup-postgres-config.yaml | 15 ----------- .../templates/nuke-deployments-hook.yaml | 24 ------------------ .../nextcloud/{1.6.46 => 1.6.47}/.helmignore | 0 .../nextcloud/{1.6.46 => 1.6.47}/Chart.lock | 0 .../nextcloud/{1.6.46 => 1.6.47}/Chart.yaml | 2 +- charts/nextcloud/{1.6.46 => 1.6.47}/README.md | 0 .../{1.6.46 => 1.6.47}/app-readme.md | 0 .../charts/common-2304.0.1.tgz | Bin .../{1.6.46 => 1.6.47}/ci/test-values.yaml | 0 .../{1.6.46 => 1.6.47}/ix_values.yaml | 0 .../{1.6.46 => 1.6.47}/metadata.yaml | 0 .../migrations/migrate_from_1.1.0 | 0 .../{1.6.46 => 1.6.47}/questions.yaml | 0 .../{1.6.46 => 1.6.47}/templates/NOTES.txt | 0 .../{1.6.46 => 1.6.47}/templates/_nginx.tpl | 0 .../templates/_postgres.tpl | 0 .../templates/backup-postgres-config.yaml | 24 ++++++++++++++++++ .../templates/backup-postgres-hook.yaml | 9 +++++++ .../{1.6.46 => 1.6.47}/templates/cronjob.yaml | 0 .../templates/deployment.yaml | 0 .../templates/nextcloud-configmap.yaml | 0 .../templates/nginx-configmap.yaml | 0 .../templates/nginx-secret.yaml | 0 .../templates/postgres-deployment.yaml | 0 .../templates/postgres-secret.yaml | 0 .../templates/postgres-service.yaml | 0 .../{1.6.46 => 1.6.47}/templates/secrets.yaml | 0 .../{1.6.46 => 1.6.47}/templates/service.yaml | 0 .../templates/serviceaccount.yaml | 0 29 files changed, 34 insertions(+), 40 deletions(-) delete mode 100644 charts/nextcloud/1.6.46/templates/backup-postgres-config.yaml delete mode 100644 charts/nextcloud/1.6.46/templates/nuke-deployments-hook.yaml rename charts/nextcloud/{1.6.46 => 1.6.47}/.helmignore (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/Chart.lock (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/Chart.yaml (98%) rename charts/nextcloud/{1.6.46 => 1.6.47}/README.md (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/app-readme.md (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/charts/common-2304.0.1.tgz (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/ci/test-values.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/ix_values.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/metadata.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/migrations/migrate_from_1.1.0 (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/questions.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/NOTES.txt (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/_nginx.tpl (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/_postgres.tpl (100%) create mode 100644 charts/nextcloud/1.6.47/templates/backup-postgres-config.yaml rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/backup-postgres-hook.yaml (80%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/cronjob.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/deployment.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/nextcloud-configmap.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/nginx-configmap.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/nginx-secret.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/postgres-deployment.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/postgres-secret.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/postgres-service.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/secrets.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/service.yaml (100%) rename charts/nextcloud/{1.6.46 => 1.6.47}/templates/serviceaccount.yaml (100%) diff --git a/charts/nextcloud/1.6.46/templates/backup-postgres-config.yaml b/charts/nextcloud/1.6.46/templates/backup-postgres-config.yaml deleted file mode 100644 index c9ccf66dba..0000000000 --- a/charts/nextcloud/1.6.46/templates/backup-postgres-config.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: "postgres-backup-hook-config-map" - annotations: - rollme: {{ randAlphaNum 5 | quote }} -data: - entrypoint.sh: |- - #!/bin/sh - cmd="/docker-entrypoint.sh postgres" - eval "${cmd}" & disown; - until pg_isready; do - sleep 5; - done; - pg_dump -U $POSTGRES_USER -d {{ template "postgres.DatabaseName" . }} > /postgres_backups/$BACKUP_NAME; diff --git a/charts/nextcloud/1.6.46/templates/nuke-deployments-hook.yaml b/charts/nextcloud/1.6.46/templates/nuke-deployments-hook.yaml deleted file mode 100644 index 218ea00220..0000000000 --- a/charts/nextcloud/1.6.46/templates/nuke-deployments-hook.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{{- if .Values.ixChartContext.isUpgrade -}} -{{ $values := (. | mustDeepCopy) }} -{{ $_ := set $values "common" (dict "nameSuffix" "postgres") }} -apiVersion: batch/v1 -kind: Job -metadata: - name: "pre-upgrade-hook1" - annotations: - "helm.sh/hook": pre-upgrade - "helm.sh/hook-weight": "-1" - "helm.sh/hook-delete-policy": hook-succeeded - rollme: {{ randAlphaNum 5 | quote }} -spec: - template: - metadata: - name: "pre-upgrade-hook1" - spec: - restartPolicy: Never - serviceAccountName: "{{ template "common.names.serviceAccountName" . }}" - containers: - - name: kubectl - image: "bitnami/kubectl:1.19" - command: ["kubectl", "delete" , "deployment", "{{ template "common.names.fullname" . }}", "{{ template "common.names.fullname" $values }}"] -{{- end -}} diff --git a/charts/nextcloud/1.6.46/.helmignore b/charts/nextcloud/1.6.47/.helmignore similarity index 100% rename from charts/nextcloud/1.6.46/.helmignore rename to charts/nextcloud/1.6.47/.helmignore diff --git a/charts/nextcloud/1.6.46/Chart.lock b/charts/nextcloud/1.6.47/Chart.lock similarity index 100% rename from charts/nextcloud/1.6.46/Chart.lock rename to charts/nextcloud/1.6.47/Chart.lock diff --git a/charts/nextcloud/1.6.46/Chart.yaml b/charts/nextcloud/1.6.47/Chart.yaml similarity index 98% rename from charts/nextcloud/1.6.46/Chart.yaml rename to charts/nextcloud/1.6.47/Chart.yaml index 25c400f7ea..5e48831960 100644 --- a/charts/nextcloud/1.6.46/Chart.yaml +++ b/charts/nextcloud/1.6.47/Chart.yaml @@ -4,7 +4,7 @@ description: A file sharing server that puts the control and security of your ow annotations: title: Nextcloud type: application -version: 1.6.46 +version: 1.6.47 apiVersion: v2 appVersion: 27.0.2 kubeVersion: '>=1.16.0-0' diff --git a/charts/nextcloud/1.6.46/README.md b/charts/nextcloud/1.6.47/README.md similarity index 100% rename from charts/nextcloud/1.6.46/README.md rename to charts/nextcloud/1.6.47/README.md diff --git a/charts/nextcloud/1.6.46/app-readme.md b/charts/nextcloud/1.6.47/app-readme.md similarity index 100% rename from charts/nextcloud/1.6.46/app-readme.md rename to charts/nextcloud/1.6.47/app-readme.md diff --git a/charts/nextcloud/1.6.46/charts/common-2304.0.1.tgz b/charts/nextcloud/1.6.47/charts/common-2304.0.1.tgz similarity index 100% rename from charts/nextcloud/1.6.46/charts/common-2304.0.1.tgz rename to charts/nextcloud/1.6.47/charts/common-2304.0.1.tgz diff --git a/charts/nextcloud/1.6.46/ci/test-values.yaml b/charts/nextcloud/1.6.47/ci/test-values.yaml similarity index 100% rename from charts/nextcloud/1.6.46/ci/test-values.yaml rename to charts/nextcloud/1.6.47/ci/test-values.yaml diff --git a/charts/nextcloud/1.6.46/ix_values.yaml b/charts/nextcloud/1.6.47/ix_values.yaml similarity index 100% rename from charts/nextcloud/1.6.46/ix_values.yaml rename to charts/nextcloud/1.6.47/ix_values.yaml diff --git a/charts/nextcloud/1.6.46/metadata.yaml b/charts/nextcloud/1.6.47/metadata.yaml similarity index 100% rename from charts/nextcloud/1.6.46/metadata.yaml rename to charts/nextcloud/1.6.47/metadata.yaml diff --git a/charts/nextcloud/1.6.46/migrations/migrate_from_1.1.0 b/charts/nextcloud/1.6.47/migrations/migrate_from_1.1.0 similarity index 100% rename from charts/nextcloud/1.6.46/migrations/migrate_from_1.1.0 rename to charts/nextcloud/1.6.47/migrations/migrate_from_1.1.0 diff --git a/charts/nextcloud/1.6.46/questions.yaml b/charts/nextcloud/1.6.47/questions.yaml similarity index 100% rename from charts/nextcloud/1.6.46/questions.yaml rename to charts/nextcloud/1.6.47/questions.yaml diff --git a/charts/nextcloud/1.6.46/templates/NOTES.txt b/charts/nextcloud/1.6.47/templates/NOTES.txt similarity index 100% rename from charts/nextcloud/1.6.46/templates/NOTES.txt rename to charts/nextcloud/1.6.47/templates/NOTES.txt diff --git a/charts/nextcloud/1.6.46/templates/_nginx.tpl b/charts/nextcloud/1.6.47/templates/_nginx.tpl similarity index 100% rename from charts/nextcloud/1.6.46/templates/_nginx.tpl rename to charts/nextcloud/1.6.47/templates/_nginx.tpl diff --git a/charts/nextcloud/1.6.46/templates/_postgres.tpl b/charts/nextcloud/1.6.47/templates/_postgres.tpl similarity index 100% rename from charts/nextcloud/1.6.46/templates/_postgres.tpl rename to charts/nextcloud/1.6.47/templates/_postgres.tpl diff --git a/charts/nextcloud/1.6.47/templates/backup-postgres-config.yaml b/charts/nextcloud/1.6.47/templates/backup-postgres-config.yaml new file mode 100644 index 0000000000..9b6e719201 --- /dev/null +++ b/charts/nextcloud/1.6.47/templates/backup-postgres-config.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: "postgres-backup-hook-config-map" + annotations: + rollme: {{ randAlphaNum 5 | quote }} +data: + entrypoint.sh: |- + #!/bin/bash + echo "Fetching password from config.php" + + # sed removes ' , => spaces and db* from the string + DBUSER=$(cat /nc-config/config.php | grep "dbuser" | sed "s/dbuser\| \|'\|,\|=>//g") + DBPASS=$(cat /nc-config/config.php | grep "dbpassword" | sed "s/dbpassword\| \|'\|,\|=>//g") + DBNAME=$(cat /nc-config/config.php | grep "dbname" | sed "s/dbname\| \|'\|,\|=>//g") + [ -n "$DBUSER" ] && [ -n "$DBPASS" ] && [ -n "$DBNAME" ] && echo "User, Database and password fetched from config.php" + + until pg_isready -U ${POSTGRES_USER} -h ${POSTGRES_HOST}; do sleep 2; done + + # pg_dump will automatically use the password from the PGPASSWORD environment variable + echo "Creating backup of ${DBNAME} database as ${DBUSER}" + PGPASSWORD=${DBPASS} pg_dump -U $DBUSER -d $DBNAME --host=${POSTGRES_HOST} > /postgres_backups/$BACKUP_NAME \ + && echo "Backup created successfully" \ + || echo "Backup failed" diff --git a/charts/nextcloud/1.6.46/templates/backup-postgres-hook.yaml b/charts/nextcloud/1.6.47/templates/backup-postgres-hook.yaml similarity index 80% rename from charts/nextcloud/1.6.46/templates/backup-postgres-hook.yaml rename to charts/nextcloud/1.6.47/templates/backup-postgres-hook.yaml index 175b0f2617..f7b13fda69 100644 --- a/charts/nextcloud/1.6.46/templates/backup-postgres-hook.yaml +++ b/charts/nextcloud/1.6.47/templates/backup-postgres-hook.yaml @@ -1,6 +1,7 @@ {{- if .Values.ixChartContext.isUpgrade -}} {{ $values := (. | mustDeepCopy) }} {{ $_ := set $values "common" (dict "nameSuffix" "postgres") }} +{{ $dbHost := .Values.nextcloudDbHost }} apiVersion: batch/v1 kind: Job metadata: @@ -24,11 +25,16 @@ spec: env: {{ include "postgres.envVariableConfiguration" $values | nindent 10 }} - name: BACKUP_NAME value: {{ template "postgres.backupName" . }} + - name: POSTGRES_HOST + value: {{ $dbHost }} volumeMounts: {{ include "postgres.volumeMountsConfiguration" $values | nindent 10 }} - name: backup-script-configmap mountPath: /bin/backup_entrypoint.sh readOnly: true subPath: entrypoint.sh + - name: nextcloud-data + mountPath: /nc-config + subPath: "config" command: - "/bin/backup_entrypoint.sh" volumes: {{ include "postgres.volumeConfiguration" $values | nindent 8 }} @@ -36,4 +42,7 @@ spec: configMap: defaultMode: 0700 name: "postgres-backup-hook-config-map" + {{ if .Values.appVolumeMounts }} + {{- include "common.storage.configureAppVolumes" .Values | nindent 8 }} + {{ end }} {{- end -}} diff --git a/charts/nextcloud/1.6.46/templates/cronjob.yaml b/charts/nextcloud/1.6.47/templates/cronjob.yaml similarity index 100% rename from charts/nextcloud/1.6.46/templates/cronjob.yaml rename to charts/nextcloud/1.6.47/templates/cronjob.yaml diff --git a/charts/nextcloud/1.6.46/templates/deployment.yaml b/charts/nextcloud/1.6.47/templates/deployment.yaml similarity index 100% rename from charts/nextcloud/1.6.46/templates/deployment.yaml rename to charts/nextcloud/1.6.47/templates/deployment.yaml diff --git a/charts/nextcloud/1.6.46/templates/nextcloud-configmap.yaml b/charts/nextcloud/1.6.47/templates/nextcloud-configmap.yaml similarity index 100% rename from charts/nextcloud/1.6.46/templates/nextcloud-configmap.yaml rename to charts/nextcloud/1.6.47/templates/nextcloud-configmap.yaml diff --git a/charts/nextcloud/1.6.46/templates/nginx-configmap.yaml b/charts/nextcloud/1.6.47/templates/nginx-configmap.yaml similarity index 100% rename from charts/nextcloud/1.6.46/templates/nginx-configmap.yaml rename to charts/nextcloud/1.6.47/templates/nginx-configmap.yaml diff --git a/charts/nextcloud/1.6.46/templates/nginx-secret.yaml b/charts/nextcloud/1.6.47/templates/nginx-secret.yaml similarity index 100% rename from charts/nextcloud/1.6.46/templates/nginx-secret.yaml rename to charts/nextcloud/1.6.47/templates/nginx-secret.yaml diff --git a/charts/nextcloud/1.6.46/templates/postgres-deployment.yaml b/charts/nextcloud/1.6.47/templates/postgres-deployment.yaml similarity index 100% rename from charts/nextcloud/1.6.46/templates/postgres-deployment.yaml rename to charts/nextcloud/1.6.47/templates/postgres-deployment.yaml diff --git a/charts/nextcloud/1.6.46/templates/postgres-secret.yaml b/charts/nextcloud/1.6.47/templates/postgres-secret.yaml similarity index 100% rename from charts/nextcloud/1.6.46/templates/postgres-secret.yaml rename to charts/nextcloud/1.6.47/templates/postgres-secret.yaml diff --git a/charts/nextcloud/1.6.46/templates/postgres-service.yaml b/charts/nextcloud/1.6.47/templates/postgres-service.yaml similarity index 100% rename from charts/nextcloud/1.6.46/templates/postgres-service.yaml rename to charts/nextcloud/1.6.47/templates/postgres-service.yaml diff --git a/charts/nextcloud/1.6.46/templates/secrets.yaml b/charts/nextcloud/1.6.47/templates/secrets.yaml similarity index 100% rename from charts/nextcloud/1.6.46/templates/secrets.yaml rename to charts/nextcloud/1.6.47/templates/secrets.yaml diff --git a/charts/nextcloud/1.6.46/templates/service.yaml b/charts/nextcloud/1.6.47/templates/service.yaml similarity index 100% rename from charts/nextcloud/1.6.46/templates/service.yaml rename to charts/nextcloud/1.6.47/templates/service.yaml diff --git a/charts/nextcloud/1.6.46/templates/serviceaccount.yaml b/charts/nextcloud/1.6.47/templates/serviceaccount.yaml similarity index 100% rename from charts/nextcloud/1.6.46/templates/serviceaccount.yaml rename to charts/nextcloud/1.6.47/templates/serviceaccount.yaml