helmfile.yaml 1.98 KB
environments:
  default:
    values:
      - namespace: wordpress
        namePrefix: "test-"
        wordpress:
          jsonPatches: []
          strategicMergePatches: []
          database:
            name: "wordpress"
            user: "wordpress"
            password: "wordpress"
            prefix: "wp_"
        mariadbServer:
          rootPassword: "CHANGEME"

---

helmfiles:
  - path: ../mariadb-server/helmfile.yaml
    values:
      - namespace: {{ .Values.namespace }}
        namePrefix: {{ .Values.namePrefix }}wordpress-
      - mariadbServer:
          rootPassword: {{ .Values.mariadbServer.rootPassword }}
          database: {{ .Values.wordpress.database.name }}
          user: {{ .Values.wordpress.database.user }}
          password: {{ .Values.wordpress.database.password }}

releases:
  - name: {{ .Values.namePrefix }}wordpress
    namespace: {{ .Values.namespace }}
    chart: .
    values:
      - set-common-values.yaml.gotmpl
    jsonPatches:
      {{- if not (empty (.Values.wordpress.jsonPatches)) }}
      {{- .Values.wordpress.jsonPatches | toYaml | indent 6 }}
      {{- end }}
    strategicMergePatches:
      - apiVersion: v1
        kind: ConfigMap
        metadata:
          name: {{ .Values.namePrefix }}wordpress-config
          namespace: {{ .Values.namespace }}
        data:
          WORDPRESS_DB_HOST: {{ .Values.namePrefix }}wordpress-mariadb
          WORDPRESS_DB_NAME: {{ .Values.wordpress.database.name }}
          WORDPRESS_DB_USER: {{ .Values.wordpress.database.user }}
      - apiVersion: v1
        kind: Secret
        metadata:
          name: {{ .Values.namePrefix }}wordpress-secret
          namespace: {{ .Values.namespace }}
        stringData:
          WORDPRESS_DB_PASSWORD: {{ .Values.wordpress.database.password }}
          WORDPRESS_TABLE_PREFIX: {{ .Values.wordpress.database.prefix }}
      {{- if not (empty (.Values.wordpress.strategicMergePatches)) }}
      {{- .Values.wordpress.strategicMergePatches | toYaml | indent 6 }}
      {{- end }}