--- a/ChangeLog Mon Jun 19 21:46:01 2017 -0500
+++ b/ChangeLog Tue Jul 04 17:15:12 2017 -0500
@@ -1,5 +1,6 @@
- * Nothing yet... Be the first!!
+ * Allow labels for the Docker run and build tasks to use environment + variables. (fixed #112) * Added support for passing arguments to the Docker build task (--build-arg).
--- a/docker/build.go Mon Jun 19 21:46:01 2017 -0500
+++ b/docker/build.go Tue Jul 04 17:15:12 2017 -0500
@@ -87,7 +87,7 @@
"dockerfile": filepath.Join(tmpDir, filepath.Base(b.Dockerfile)),
"tag": environment.Mapper(b.Tag, fullEnv),
+ "Labels": environment.SliceMapper(b.Labels, fullEnv), "Arguments": b.Arguments,
--- a/docker/run.go Mon Jun 19 21:46:01 2017 -0500
+++ b/docker/run.go Tue Jul 04 17:15:12 2017 -0500
@@ -155,7 +155,7 @@
"EntryPoint": entryPoint,
"Image": environment.Mapper(r.Image, fullEnv),
+ "Labels": environment.SliceMapper(r.Labels, fullEnv), "ScriptFile": scriptFile,
"SSHAgent": st.EnableSSHAgent,
--- a/environment/mapper.go Mon Jun 19 21:46:01 2017 -0500
+++ b/environment/mapper.go Tue Jul 04 17:15:12 2017 -0500
@@ -57,3 +57,14 @@
+// SliceMapper calls Mapper for each item in a slice and returns a new slice. +func SliceMapper(slice []string, env []string) []string { + for _, template := range slice { + mapped = append(mapped, Mapper(template, env))