From faaa8c17ca08d22563ab0153b7f964d937f269bf Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 23 Jan 2019 11:56:29 +0800 Subject: [PATCH] FEATURE: Support `{{config}}` replacement to template name in `env`. --- README.md | 14 ++++++++++++++ launcher | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e8762b2..4fd4a63 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,20 @@ links: Links another container to the current container. This will add `--link postgres:postgres` to the options when running the container. +#### environment variables: + +Setting environment variables to the current container. + +``` +# app.yml + +env: + DISCOURSE_DB_HOST: some-host + DISCOURSE_DB_NAME: {{config}}_discourse +``` + +The above will add `-e DISCOURSE_DB_HOST=some-host -e DISCOURSE_DB_NAME=app_discourse` to the options when running the container. + #### labels: ``` # app.yml diff --git a/launcher b/launcher index 30245c8..d45b713 100755 --- a/launcher +++ b/launcher @@ -353,7 +353,7 @@ RUBY if [ "$i" == "*ERROR." ]; then ok=0 elif [ -n "$i" ]; then - env[${#env[@]}]=$i + env[${#env[@]}]=$(echo $i | sed s/{{config}}/${config}/g) fi done <<< "$raw" -- 2.25.1