common.yaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. {{- include "ix.v1.common.loader.init" . -}}
  2. {{- include "nextcloud.migration" $ -}}
  3. {{/* Merge the templates with Values */}}
  4. {{- $_ := mustMergeOverwrite .Values (include "nextcloud.workload" $ | fromYaml) -}}
  5. {{- $_ := mustMergeOverwrite .Values (include "nextcloud.configuration" $ | fromYaml) -}}
  6. {{- $_ := mustMergeOverwrite .Values (include "nextcloud.configs" $ | fromYaml) -}}
  7. {{- if .Values.ncNetwork.certificateID }}
  8. {{- $_ := mustMergeOverwrite .Values (include "nginx.workload" $ | fromYaml) -}}
  9. {{- end }}
  10. {{- if .Values.ncConfig.cron.enabled }}
  11. {{- $_ := mustMergeOverwrite .Values (include "nextcloud.cron" $ | fromYaml) -}}
  12. {{- end }}
  13. {{- $_ := mustMergeOverwrite .Values (include "nginx.configuration" $ | fromYaml) -}}
  14. {{- $_ := mustMergeOverwrite .Values (include "postgres.workload" $ | fromYaml) -}}
  15. {{- $_ := mustMergeOverwrite .Values (include "redis.workload" $ | fromYaml) -}}
  16. {{- $_ := mustMergeOverwrite .Values (include "nextcloud.service" $ | fromYaml) -}}
  17. {{- $_ := mustMergeOverwrite .Values (include "nextcloud.persistence" $ | fromYaml) -}}
  18. {{/* Mutate postgres backup command to handle nextcloud config */}}
  19. {{- $cmd := .Values.workload.postgresbackup.podSpec.containers.postgresbackup.command -}}
  20. {{- $temp := printf ("%s\n%s\n%s\n%s\n%s\n%s\n%s")
  21. "echo 'Fetching password from config.php'"
  22. "# sed removes ' , => spaces and db* from the string"
  23. "POSTGRES_USER=$(cat /nc-config/config/config.php | grep 'dbuser' | sed \"s/dbuser\\| \\|'\\|,\\|=>//g\")"
  24. "POSTGRES_PASSWORD=$(cat /nc-config/config/config.php | grep 'dbpassword' | sed \"s/dbpassword\\| \\|'\\|,\\|=>//g\")"
  25. "POSTGRES_DB=$(cat /nc-config/config/config.php | grep 'dbname' | sed \"s/dbname\\| \\|'\\|,\\|=>//g\")"
  26. "[ -n \"$POSTGRES_USER\" ] && [ -n \"$POSTGRES_PASSWORD\" ] && [ -n \"$POSTGRES_DB\" ] && echo 'User, Database and password fetched from config.php'"
  27. (index $cmd 2) -}}
  28. {{- $newCmd := (list (index $cmd 0) (index $cmd 1) $temp) -}}
  29. {{- $_ := set .Values.workload.postgresbackup.podSpec.containers.postgresbackup "command" $newCmd -}}
  30. {{- $_ := set .Values.workload.postgresbackup.podSpec "securityContext" (dict "fsGroup" "33") -}}
  31. {{/* Create the configmap for portal manually*/}}
  32. {{- include "nextcloud.portal" $ -}}
  33. {{- include "ix.v1.common.loader.apply" . -}}