grim/convey

645b5749078c
Parents 212b446dc69b
Children bfe6950d167e
Add support for --build-arg to docker build. Fixes #106
--- a/ChangeLog Mon May 22 00:02:20 2017 -0500
+++ b/ChangeLog Tue May 30 20:45:02 2017 -0500
@@ -1,5 +1,6 @@
0.7.0:
- * Nothing yet :( Be the first!!
+ * Added support for passing arguments to the Docker build task (--build-arg).
+ (fixed #106)
0.6.0: 20170515
* Added GIT_BRANCH_NORMALIZED and HG_BRANCH_NORMALIZED variables into the
--- a/docker/build.go Mon May 22 00:02:20 2017 -0500
+++ b/docker/build.go Tue May 30 20:45:02 2017 -0500
@@ -37,12 +37,14 @@
Files []string `yaml:"files"`
Tag string `yaml:"tag"`
Labels []string `yaml:"labels"`
+ Arguments []string `yaml:"arguments"`
}
const buildTemplate = `docker build
-f {{.dockerfile}}
{{if .tag}} -t {{.tag}}{{end}}
{{range .Labels}} --label '{{.}}'{{end}}
+{{range .Arguments}} --build-arg {{.}}{{end}}
{{.buildContext}}`
func (b *Build) Execute(name string, ws *workspace.Workspace, logger *gomol.LogAdapter, env []string, st *state.State) error {
@@ -86,6 +88,7 @@
"tag": environment.Mapper(b.Tag, fullEnv),
"buildContext": tmpDir,
"Labels": b.Labels,
+ "Arguments": b.Arguments,
}
return command.Run(name, buildTemplate, params, st.TaskTimeout)