From: Guo Xiang Tan Date: Fri, 10 Nov 2017 07:18:48 +0000 (+0800) Subject: FEATURE: Add support for `{{config}}` variable in labels. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e66e05b87ac6e933a5317483c7a45eded6241bfc;p=discourse_docker.git FEATURE: Add support for `{{config}}` variable in labels. --- diff --git a/README.md b/README.md index cfb1091..fb958b9 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,18 @@ links: Links another container to the current container. This will add `--link postgres:postgres` to the options when running the container. +#### labels: +``` +# app.yml + +labels: + monitor: 'true' + app_name: {{config}}_discourse +``` + +Add labels to the current container. The above will add `--l monitor=true -l app_name=dev_discourse` to the options +when running the container + ### Upgrading Discourse The Docker setup gives you multiple upgrade options: diff --git a/launcher b/launcher index 4d16765..ba05c88 100755 --- a/launcher +++ b/launcher @@ -307,7 +307,7 @@ set_template_info() { require 'yaml' input=STDIN.readlines.join - # default to UTF-8 for the dbs sake + # default to UTF-8 for the dbs sakeb env = {'LANG' => 'en_US.UTF-8'} input.split('_FILE_SEPERATOR_').each do |yml| yml.strip! @@ -371,7 +371,7 @@ RUBY if [ "$i" == "*ERROR." ]; then ok=0 elif [ -n "$i" ]; then - labels[${#labels[@]}]=$i + labels[${#labels[@]}]=$(echo $i | sed s/{{config}}/${config}/) fi done <<< "$raw"