Docker config: Quote env vars read by m4

This commit is contained in:
Gernot Schulz 2020-10-08 14:45:23 +02:00
parent d2043f508c
commit 2305ca9d21
2 changed files with 6 additions and 2 deletions

View File

@ -8,7 +8,9 @@ dnl ( set -a; source .env; m4 docker-compose.yml.m4 ) > docker-compose.yml
dnl dnl
dnl ---------------------------------------- dnl ----------------------------------------
divert(-1)dnl divert(-1)dnl
define(`read_env', `esyscmd(`printf "%s" "$$1"')') dnl return env variable (quoted)
define(`read_env', `esyscmd(`printf "\`%s'" "$$1"')')
dnl return env variable if set; otherwise, return given alternative value
define(`ifenvelse', `ifelse(read_env(`$1'),, `$2', read_env(`$1'))') define(`ifenvelse', `ifelse(read_env(`$1'),, `$2', read_env(`$1'))')
define(`BACKEND_IMAGE', define(`BACKEND_IMAGE',

View File

@ -8,7 +8,9 @@ dnl ( set -a; source .env; m4 docker-stack.yml.m4 ) > docker-stack.yml
dnl dnl
dnl ---------------------------------------- dnl ----------------------------------------
divert(-1)dnl divert(-1)dnl
define(`read_env', `esyscmd(`printf "%s" "$$1"')') dnl return env variable (quoted)
define(`read_env', `esyscmd(`printf "\`%s'" "$$1"')')
dnl return env variable if set; otherwise, return given alternative value
define(`ifenvelse', `ifelse(read_env(`$1'),, `$2', read_env(`$1'))') define(`ifenvelse', `ifelse(read_env(`$1'),, `$2', read_env(`$1'))')
define(`BACKEND_IMAGE', define(`BACKEND_IMAGE',