From cb85d1481574dcdcec1e52bf98102f91bddfa6d9 Mon Sep 17 00:00:00 2001 From: VictorNguyen098 <72439709+VictorNguyen098@users.noreply.github.com> Date: Fri, 24 Nov 2023 17:47:34 +0100 Subject: [PATCH] modify cron (#75) * modify cron * change values * rollback old version --- charts/redcap/Chart.yaml | 2 +- charts/redcap/templates/conf.yaml | 4 +- charts/redcap/templates/cron.yaml | 110 ++++++++++++++++-------------- charts/redcap/values.yaml | 7 ++ 4 files changed, 67 insertions(+), 56 deletions(-) diff --git a/charts/redcap/Chart.yaml b/charts/redcap/Chart.yaml index 8f90a49..6f4d8a1 100644 --- a/charts/redcap/Chart.yaml +++ b/charts/redcap/Chart.yaml @@ -3,7 +3,7 @@ name: redcap description: Helm chart for RedCap, A CRF Application for survey research. type: application appVersion: 10.6.13 -version: 1.10.15 +version: 1.10.17 home: https://github.com/curie-data-factory/helm-charts/tree/master/charts/redcap icon: https://www.redcapbrasil.com.br/wp-content/uploads/2018/02/rbone.png sources: diff --git a/charts/redcap/templates/conf.yaml b/charts/redcap/templates/conf.yaml index 54d9f93..187c25f 100644 --- a/charts/redcap/templates/conf.yaml +++ b/charts/redcap/templates/conf.yaml @@ -34,12 +34,12 @@ data: {{ .Values.mail.config | indent 4 }} {{- end }} --- -{{- if .Values.mail.enabled }} +{{- if .Values.cron.enabled }} apiVersion: v1 kind: ConfigMap metadata: name: "{{ .Release.Name | trunc 63 }}-conf-mail-cron" data: boot-cron.sh: |- -{{ .Values.mail.config | indent 4 }} +{{ .Values.cron.config | indent 4 }} {{- end }} diff --git a/charts/redcap/templates/cron.yaml b/charts/redcap/templates/cron.yaml index ceb52b3..f80301b 100644 --- a/charts/redcap/templates/cron.yaml +++ b/charts/redcap/templates/cron.yaml @@ -17,58 +17,62 @@ spec: name: redcap-cron spec: containers: - - args: - - /usr/bin/php - - /var/www/site/cron.php + - name: redcap-cron + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: + - /usr/bin/php + - /var/www/site/cron.php env: - - name: DB_HOSTNAME - value: {{.Values.DB_HOSTNAME}} - - name: DB_NAME - value: {{.Values.DB_NAME}} - - name: DB_USERNAME - value: {{.Values.DB_USERNAME}} - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - key: DB_PASSWORD - name: redcap-server-secrets - optional: false - - name: SALT - valueFrom: - secretKeyRef: - key: SALT - name: redcap-server-secrets - optional: false - {{- if .Values.mail.enabled }} - volumeMounts: - - mountPath: /config/mail - name: mail - - mountPath: /config - name: cron-bootstrap + - name: DB_HOSTNAME + value: {{.Values.DB_HOSTNAME}} + - name: DB_NAME + value: {{.Values.DB_NAME}} + - name: DB_USERNAME + value: {{.Values.DB_USERNAME}} + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + key: DB_PASSWORD + name: redcap-server-secrets + optional: false + - name: SALT + valueFrom: + secretKeyRef: + key: SALT + name: redcap-server-secrets + optional: false + {{- if .Values.mail.enabled }} + volumeMounts: + - mountPath: /config/mail + name: mail + {{- end }} + {{- if .Values.cron.enabled }} + - mountPath: /config + name: cron-bootstrap + {{- end }} + {{- if .Values.image.deployRegistry }} + imagePullSecrets: + - name: "{{ .Values.image.name }}-{{ .Values.image.imagePullSecrets }}" {{- end }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - name: redcap-cron - {{- if .Values.image.deployRegistry }} - imagePullSecrets: - - name: "{{ .Values.image.name }}-{{ .Values.image.imagePullSecrets }}" - {{- end }} - {{- if .Values.mail.enabled }} - volumes: - - configMap: - defaultMode: 256 - items: - - key: cron-php.sh - path: ./cron-php.sh - name: "{{ .Release.Name }}-conf-mail-cron" - optional: false - name: cron-bootstrap - - configMap: - defaultMode: 420 - name: "{{ .Release.Name }}-conf-mail" - items: - - key: msmtprc - path: ./msmtprc - name: mail - {{- end }} - restartPolicy: Never \ No newline at end of file + volumes: + {{- if .Values.cron.enabled }} + - configMap: + defaultMode: 256 + items: + - key: boot-cron.sh + path: ./boot-cron.sh + name: "{{ .Release.Name }}-conf-mail-cron" + optional: false + name: cron-bootstrap + {{- end }} + {{- if .Values.mail.enabled }} + - configMap: + defaultMode: 420 + name: "{{ .Release.Name }}-conf-mail" + items: + - key: msmtprc + path: ./msmtprc + name: mail + {{- end }} + restartPolicy: Never diff --git a/charts/redcap/values.yaml b/charts/redcap/values.yaml index f1bbb5a..da09e52 100644 --- a/charts/redcap/values.yaml +++ b/charts/redcap/values.yaml @@ -21,6 +21,13 @@ mail: # Set a default account account default : redcapmailuser +cron: + enabled: true + config: |- + #!/bin/bash + cp /config/mail/msmtprc /etc/msmtprc + + /usr/bin/php /var/www/site/cron.php livenesscheck: true service: