Skip to content

Commit

Permalink
modify cron (#75)
Browse files Browse the repository at this point in the history
* modify cron

* change values

* rollback old version
  • Loading branch information
VictorNguyen098 authored Nov 24, 2023
1 parent 4370ec9 commit cb85d14
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 56 deletions.
2 changes: 1 addition & 1 deletion charts/redcap/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions charts/redcap/templates/conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
110 changes: 57 additions & 53 deletions charts/redcap/templates/cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
7 changes: 7 additions & 0 deletions charts/redcap/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit cb85d14

Please sign in to comment.