Browse Source

fix: dev: [cron] correct invalid usage of ``pipefail``

upd
Valentin Lab 6 months ago
parent
commit
f0a41006c0
  1. 2
      cron/hooks/pre_deploy
  2. 8
      cron/test/entries_from_service

2
cron/hooks/pre_deploy

@ -6,7 +6,7 @@ set -e
root_crontab="$SERVICE_CONFIGSTORE/etc/crontabs/root"
cron_content=$(set pipefail; cron:entries | tr '\0' '\n') || {
cron_content=$(set -o pipefail; cron:entries | tr '\0' '\n') || {
err "Failed to make cron entries" >&2
exit 1
}

8
cron/test/entries_from_service

@ -108,7 +108,7 @@ is out '' TRIM
try "
set pipefail &&
set -o pipefail &&
cron:entries_from_service 'foo' '
(0 0 * * *) {-p 10 -k} dc run --rm foo
' | tr '\0' '\n'" "one command no label"
@ -119,7 +119,7 @@ is out "\
try "
set pipefail &&
set -o pipefail &&
cron:entries_from_service 'foo' '
wiz: (0 0 * * *) {-p 10 -k} dc run --rm foo
' | tr '\0' '\n'" "one command with label"
@ -131,7 +131,7 @@ is out "\
try "
set pipefail &&
set -o pipefail &&
cron:entries_from_service 'foo' '
wiz: (0 0 * * *) {-p 10 -k} dc run --rm foo
bam: (@daily) {-p 10 -D -k} dc run --rm foo --hop
@ -146,7 +146,7 @@ is out "\
try "
set pipefail &&
set -o pipefail &&
cron:entries_from_service 'foo' '!var-expand
(0 0 * * *) {-p 10 -k} dc run --rm \$BASE_SERVICE_NAME \$MASTER_BASE_SERVICE_NAME
' | tr '\0' '\n'" "using relation's var"

Loading…
Cancel
Save