FEATURE: Add support for `{{config}}` variable in labels.
authorGuo Xiang Tan <tgx_world@hotmail.com>
Fri, 10 Nov 2017 07:18:48 +0000 (15:18 +0800)
committerGuo Xiang Tan <tgx_world@hotmail.com>
Fri, 10 Nov 2017 07:18:48 +0000 (15:18 +0800)
README.md
launcher

index cfb1091f5c64437db49471bdd896b09e3c1a1517..fb958b99db63d2e23afc3141d3a794ee180352f5 100644 (file)
--- 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:
index 4d167657fc9bc08e6de8648ce2eb05cbccee4dfd..ba05c88e30836137080849c197f6f50b3e959426 100755 (executable)
--- 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"