nixos/discourse: Fail on file errors
Bash doesn't handle subshell errors properly if the result is used as input to a command. To cause the services to fail when the files can't be read, we need to assign the value to a variable, then export it separately.
This commit is contained in:
parent
2db1ae068d
commit
515fb48312
@ -726,7 +726,8 @@ in
|
|||||||
export ADMIN_EMAIL="${cfg.admin.email}"
|
export ADMIN_EMAIL="${cfg.admin.email}"
|
||||||
export ADMIN_NAME="${cfg.admin.fullName}"
|
export ADMIN_NAME="${cfg.admin.fullName}"
|
||||||
export ADMIN_USERNAME="${cfg.admin.username}"
|
export ADMIN_USERNAME="${cfg.admin.username}"
|
||||||
export ADMIN_PASSWORD="$(<${cfg.admin.passwordFile})"
|
ADMIN_PASSWORD="$(<${cfg.admin.passwordFile})"
|
||||||
|
export ADMIN_PASSWORD
|
||||||
discourse-rake admin:create_noninteractively
|
discourse-rake admin:create_noninteractively
|
||||||
|
|
||||||
discourse-rake themes:update
|
discourse-rake themes:update
|
||||||
@ -938,7 +939,8 @@ in
|
|||||||
set -o errexit -o pipefail -o nounset -o errtrace
|
set -o errexit -o pipefail -o nounset -o errtrace
|
||||||
shopt -s inherit_errexit
|
shopt -s inherit_errexit
|
||||||
|
|
||||||
export api_key=$(<'${apiKeyPath}')
|
api_key=$(<'${apiKeyPath}')
|
||||||
|
export api_key
|
||||||
|
|
||||||
jq <${mail-receiver-json} \
|
jq <${mail-receiver-json} \
|
||||||
'.DISCOURSE_API_KEY = $ENV.api_key' \
|
'.DISCOURSE_API_KEY = $ENV.api_key' \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user