Don't generate commented out secrets. Throw an error when can't put the secret in docker

This commit is contained in:
knoflook 2021-07-03 19:43:42 +02:00
parent f2892bad6f
commit cb225908d0
1 changed files with 2 additions and 1 deletions

3
abra
View File

@ -867,7 +867,7 @@ get_servers() {
get_app_secrets() {
# FIXME 3wc: requires bash 4, use for loop instead
mapfile -t PASSWORDS < <(grep "SECRET.*VERSION.*" "$ENV_FILE")
mapfile -t PASSWORDS < <(grep "^SECRET.*VERSION.*" "$ENV_FILE")
}
load_instance() {
@ -1601,6 +1601,7 @@ sub_app_secret_insert() {
# shellcheck disable=SC2059
printf "$PW" | docker secret create "${STACK_NAME}_${SECRET}_${VERSION}" - > /dev/null
if [[ $? != 0 ]]; then exit 1; fi # exit if secret wasn't created
if [ "$STORE_WITH_PASS" == "true" ] && type pass > /dev/null 2>&1; then
echo "$PW" | pass insert "hosts/$DOCKER_CONTEXT/${STACK_NAME}/${SECRET}" -m > /dev/null