Browse Source

fix: [cron] force restart when schedule command are changed

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
pull/1/head 1.5.6
Valentin Lab 3 years ago
parent
commit
9eaf9b048d
  1. 20
      cron/hooks/pre_deploy

20
cron/hooks/pre_deploy

@ -0,0 +1,20 @@
#!/bin/bash
## Should be executable N time in a row with same result.
set -e
cron_config_hash() {
debug "Adding config hash to enable recreating upon config change."
config_hash=$({
find "$SERVICE_CONFIGSTORE/etc/cron"{,.hourly,.weekly,.daily,.monthly} \
-type f -exec md5sum {} \;
} | md5_compat) || exit 1
init-config-add "
$MASTER_BASE_SERVICE_NAME:
labels:
- compose.config_hash=$config_hash
"
}
cron_config_hash || exit 1
Loading…
Cancel
Save