grim/convey

96530de374c1
Apply environment to build task dockerfile value.
--- a/docker/build.go Tue Sep 26 12:48:02 2017 -0500
+++ b/docker/build.go Wed Sep 27 09:03:48 2017 -0500
@@ -61,8 +61,13 @@
}
defer os.RemoveAll(tmpDir)
+ dockerfile, err := environment.Mapper(b.Dockerfile, fullEnv)
+ if err != nil {
+ return err
+ }
+
// grab the dirname of the dockerfile to keep paths correct
- base := filepath.Dir(b.Dockerfile)
+ base := filepath.Dir(dockerfile)
// export the files to it
for _, src := range files {
@@ -76,7 +81,7 @@
// copy the dockerfile to the temp directory
params := map[string]interface{}{
- "source": b.Dockerfile,
+ "source": dockerfile,
"destination": tmpDir,
"workspace": st.Workspace.Name(),
}
@@ -102,7 +107,7 @@
// now run the build
params = map[string]interface{}{
- "dockerfile": filepath.Join(tmpDir, filepath.Base(b.Dockerfile)),
+ "dockerfile": filepath.Join(tmpDir, filepath.Base(dockerfile)),
"buildContext": tmpDir,
"Tags": tags,
"Labels": labels,