Add env template helper (#121)

This commit is contained in:
Frederik Ring
2022-07-06 13:16:32 +02:00
committed by GitHub
parent c2a8cc92fc
commit 342ae5910e
5 changed files with 7 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ services:
BACKUP_PRUNING_PREFIX: test
NOTIFICATION_LEVEL: info
NOTIFICATION_URLS: ${NOTIFICATION_URLS}
EXTRA_VALUE: extra-value
volumes:
- ./local:/archive
- app_data:/backup/app_data:ro

View File

@@ -1,5 +1,5 @@
{{ define "title_success" -}}
Successful test run, yay!
Successful test run with {{ env "EXTRA_VALUE" }}, yay!
{{- end }}
{{ define "body_success" -}}

View File

@@ -37,7 +37,7 @@ pass "Correct number of notifications were sent when configured."
MESSAGE_TITLE=$(curl -sSL http://admin:custom@localhost:8080/message | jq -r '.messages[0].title')
MESSAGE_BODY=$(curl -sSL http://admin:custom@localhost:8080/message | jq -r '.messages[0].message')
if [ "$MESSAGE_TITLE" != "Successful test run, yay!" ]; then
if [ "$MESSAGE_TITLE" != "Successful test run with extra-value, yay!" ]; then
fail "Unexpected notification title $MESSAGE_TITLE"
fi
pass "Custom notification title was used."