From e66e05b87ac6e933a5317483c7a45eded6241bfc Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 10 Nov 2017 15:18:48 +0800 Subject: [PATCH] FEATURE: Add support for `{{config}}` variable in labels. --- README.md | 12 ++++++++++++ launcher | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) 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" -- 2.25.1