Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customising commands like postinstall & cron #3

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions drupal/templates/cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ spec:
containers:
- name: drupal-cron
image: "{{ .Values.drupal.image }}"
command:
- drush
- cron
command: ["/bin/sh", "-c"]
args:
- {{ .Values.commands.cron | quote }}
env:
- name: PHP_FPM_CLEAR_ENV
value: "no"
Expand Down
5 changes: 1 addition & 4 deletions drupal/templates/postinstall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ spec:
image: {{ .Values.drupal.image | quote }}
command: ["/bin/sh", "-c"]
args:
- cd web;
bootstrapped=$(drush status --field=bootstrap);
if [[ $bootstrapped = *'Success'* ]]; then drush updatedb -n; drush config-import -n; drush entity-updates -n;
else drush site-install -n config_installer; conf_count=$(ls ../config/sync/ | wc -l); if [ $conf_count -lt 2 ]; then drush site-install minimal -y; fi; fi;
- {{ .Values.commands.postinstall | quote }}
env:
- name: PHP_FPM_CLEAR_ENV
value: "no"
Expand Down
8 changes: 8 additions & 0 deletions drupal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ ingress:

secrets:
hashsalt: "template-hash-salt"

commands:
postinstall: |
cd web;
bootstrapped=$(drush status --field=bootstrap);
if [[ $bootstrapped = *'Success'* ]]; then drush updatedb -n; drush config-import -n; drush entity-updates -n;
else drush site-install -n config_installer; conf_count=$(ls ../config/sync/ | wc -l); if [ $conf_count -lt 2 ]; then drush site-install minimal -y; fi; fi;
cron: drush cron