diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7b66316..0244cc7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,12 +3,20 @@ name: Deploy on: workflow_call: secrets: + kubeconfig: + description: kubeconfig stored as a base64 encrypted secret + required: true domain: description: Main project deploy domain used in URLs required: true payum-apikey: description: Payum API Key required: true + sms-dsn: + description: SMS DSN + required: true + mailer-dsn: + description: MAILER DSN storage-key: description: storage key required: true @@ -117,6 +125,8 @@ jobs: --set=ingress.tls[0].secretName=${{ needs.meta.outputs.release_name }}-tls \ --set=ingress.tls[0].hosts[0]=${{ vars.DOMAIN }} \ --set=postgresql.url="${{ secrets.database-url }}" \ + --set=postgresql.enabled='${{ github.event_name == 'pull_request' }}' \ + --set=sms.dsn="${{ secrets.sms-dsn }}" \ --set=payum.apikey="${{ secrets.payum-apikey }}" \ --set=mailer.dsn="${{ secrets.mailer-dsn }}" \ --set=php.storage.bucket="${{ vars.STORAGE_BUCKET }}" \ diff --git a/helm/chart/templates/cronjob-fixture-reset.yaml b/helm/chart/templates/cronjob-fixture-reset.yaml index fa244e2..f8dc391 100644 --- a/helm/chart/templates/cronjob-fixture-reset.yaml +++ b/helm/chart/templates/cronjob-fixture-reset.yaml @@ -1,3 +1,4 @@ +{{- if .Values.php.fixtureCron.enabled }} apiVersion: batch/v1 kind: CronJob metadata: @@ -22,19 +23,20 @@ spec: serviceAccountName: {{ include "plateforme-ebs.serviceAccountName" . }} restartPolicy: Never containers: - - name: {{ .Chart.Name }}-cronjob-notify-ms-e-7 + - name: {{ .Chart.Name }}-cronjob-fixture-reset image: "{{ .Values.php.image.repository }}:{{ .Values.php.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.php.image.pullPolicy }} command: ['/bin/sh', '-c'] - args: [' - bin/console doctrine:database:drop --if-exists --force; - bin/console doctrine:database:create --if-not-exists; - bin/console doctrine:schema:create; - bin/console doctrine:schema:validate; - bin/console messenger:setup-transports; - bin/console hautelook:fixtures:load --no-interaction -vv --no-bundles; - bin/console app:index-products; - '] + args: [' + set -ex; + bin/console doctrine:database:drop --if-exists --force; + bin/console doctrine:database:create --if-not-exists; + bin/console doctrine:schema:create; + bin/console doctrine:schema:validate; + bin/console messenger:setup-transports; + bin/console hautelook:fixtures:load --no-interaction -vv --no-bundles; + bin/console app:index-products;' + ] env: - name: API_ENTRYPOINT_HOST valueFrom: diff --git a/helm/chart/templates/fixtures-job.yaml b/helm/chart/templates/fixtures-job.yaml index 45f9245..09eca03 100644 --- a/helm/chart/templates/fixtures-job.yaml +++ b/helm/chart/templates/fixtures-job.yaml @@ -1,3 +1,4 @@ +{{- if .Values.php.fixtureJob.enabled -}} apiVersion: batch/v1 kind: Job metadata: @@ -32,18 +33,14 @@ spec: command: ['/bin/sh', '-c'] args: [' set -ex; - echo no fixtures job at the moment + bin/console doctrine:database:drop --if-exists --force; + bin/console doctrine:database:create --if-not-exists; + bin/console doctrine:schema:create; + bin/console doctrine:schema:validate; + bin/console messenger:setup-transports; + bin/console hautelook:fixtures:load --no-interaction -vv --no-bundles; + bin/console app:index-products; '] - # if [ "$APP_ENV" != "prod" ]; then - # composer install --prefer-dist --no-progress --no-suggest --no-interaction; - # fi; - # bin/console doctrine:database:drop --if-exists --force; - # bin/console doctrine:database:create --if-not-exists; - # bin/console doctrine:schema:create; - # bin/console doctrine:schema:validate; - # bin/console messenger:setup-transports; - # bin/console hautelook:fixtures:load --no-interaction -vv --no-bundles; - # bin/console app:index-products; env: - name: API_ENTRYPOINT_HOST valueFrom: @@ -208,3 +205,4 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} +{{- end }} \ No newline at end of file diff --git a/helm/chart/values-nonprod.yml b/helm/chart/values-nonprod.yml new file mode 100644 index 0000000..b38ec60 --- /dev/null +++ b/helm/chart/values-nonprod.yml @@ -0,0 +1,38 @@ +imagePullSecrets: + - name: regcred + +ingress: + className: nginx + annotations: + cert-manager.io/cluster-issuer: letsencrypt-production + hosts: + - host: toset + paths: + - path: / + pathType: Prefix + tls: + - secretName: toset + hosts: + - toset + +meilisearch: + persistence: + enabled: true + storageClass: "standard" + size: "1Gi" + +redis: + master: + persistence: + enabled: true + storageClass: "standard" + size: "1Gi" + +postgresql: + url: change_me + +php: + fixtureJob: + enabled: true + fixtureCron: + enabled: true \ No newline at end of file diff --git a/helm/chart/values-prod.yml b/helm/chart/values-prod.yml index 35498ed..c644cc5 100644 --- a/helm/chart/values-prod.yml +++ b/helm/chart/values-prod.yml @@ -29,4 +29,10 @@ redis: size: "1Gi" postgresql: - enabled: false \ No newline at end of file + url: change_me + +php: + fixtureJob: + enabled: true + fixtureCron: + enabled: true diff --git a/helm/chart/values.yaml b/helm/chart/values.yaml index d9a56fe..5eee356 100644 --- a/helm/chart/values.yaml +++ b/helm/chart/values.yaml @@ -30,6 +30,13 @@ php: usePathStyleEndpoint: true publicKey: "" secret: "" + fixtureCron: + enabled: false + fixtureJob: + enabled: false + +dailyCronjobs: + enabled: true maildev: enabled: false @@ -41,9 +48,6 @@ mailer: sms: dsn: "null://null" -dailyCronjobs: - enabled: true - consumer: # We don't use async for now so consumer isn't needed enabled: false @@ -73,6 +77,7 @@ postgresql: username: "example" password: "!ChangeMe!" database: "api" + postgresPassword: "!ChangeMe!" # Persistent Volume Storage configuration. # ref: https://kubernetes.io/docs/user-guide/persistent-volumes pullPolicy: IfNotPresent