grim/convey

4deb11e7ea44
Parents 062786196611
Children c58a163b1c39
fix up some issues with the build and export tasks
--- a/docker/build.go Wed May 27 20:44:56 2020 -0500
+++ b/docker/build.go Wed May 27 21:40:52 2020 -0500
@@ -50,10 +50,12 @@
return err
}
+ wsPath := rt.State.Workspace.Volume().Path()
+
// import all of the declared files to our task directory
for _, filespec := range b.Files {
spec := fs.ParsePathSpec(filespec)
- rt.State.Workspace.Volume().Export(spec.Source(), spec.Destination())
+ td.Import(filepath.Join(wsPath, spec.Source()), spec.Destination())
}
dockerfile := fullEnv.Map(b.Dockerfile)
--- a/tasks/export.go Wed May 27 20:44:56 2020 -0500
+++ b/tasks/export.go Wed May 27 21:40:52 2020 -0500
@@ -1,5 +1,5 @@
// Convey
-// Copyright 2016-2019 Gary Kramlich <grim@reaperworld.com>
+// Copyright 2016-2020 Gary Kramlich <grim@reaperworld.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
import (
"path/filepath"
+ "strings"
log "github.com/sirupsen/logrus"
@@ -60,7 +61,8 @@
}
for _, match := range matches {
- err = rt.State.Workspace.Volume().Export(match, spec.Destination())
+ realSrc := strings.TrimPrefix(match, rt.State.Workspace.Volume().Path())
+ err = rt.State.Workspace.Volume().Export(realSrc, spec.Destination())
if err != nil {
return err
}