From c422acba48415cb174a7ae2da342a5ed21ccb57e Mon Sep 17 00:00:00 2001 From: James Naftel Date: Wed, 26 Feb 2020 12:01:30 -0500 Subject: [PATCH] separated tar archive and docker subcommand, go version bump --- .yourbase.yml | 2 +- cli/package.go | 132 ++++++++++++++++++++++-------------- go.mod | 28 ++++---- go.sum | 45 +++++++----- workspace/build_manifest.go | 17 +++-- 5 files changed, 128 insertions(+), 96 deletions(-) diff --git a/.yourbase.yml b/.yourbase.yml index 0ac33cac..725b8f2c 100644 --- a/.yourbase.yml +++ b/.yourbase.yml @@ -1,6 +1,6 @@ dependencies: build: - - go:1.13.7 + - go:1.13.8 - python:3.6 build_targets: diff --git a/cli/package.go b/cli/package.go index bd083ea5..eb1ed39e 100644 --- a/cli/package.go +++ b/cli/package.go @@ -18,9 +18,7 @@ import ( ) type PackageCmd struct { - target string - dockerRepository string - dockerTag string + target string } func (*PackageCmd) Name() string { return "package" } @@ -31,8 +29,6 @@ func (*PackageCmd) Usage() string { func (p *PackageCmd) SetFlags(f *flag.FlagSet) { f.StringVar(&p.target, "target", "", "Target package, if not the default") - f.StringVar(&p.dockerRepository, "repository", "docker-registry.yourbase.io", "Repository base name") - f.StringVar(&p.dockerTag, "tag", "latest", "Container tag") } /* @@ -41,7 +37,9 @@ Executing the target involves: 2. Run any dependent components 3. Start target */ -func (b *PackageCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { +func (b *PackageCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { + + cmdr := subcommands.NewCommander(f, "packages") targetPackage := Package{} workspace, err := LoadWorkspace() @@ -64,55 +62,68 @@ func (b *PackageCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{ } } - instructions := targetPackage.Manifest.Package + cmdr.Register(&DockerArchiveCmd{targetPackage: targetPackage}, "") + cmdr.Register(&TarArchiveCmd{targetPackage: targetPackage}, "") - if len(instructions.Artifacts) > 0 { - if workspace.Path != "" { - b.ArchiveWorkspace(targetPackage, instructions.Artifacts) - } - } - if instructions.DockerArtifact.BaseImage != "" { - b.PackageDockerImage(targetPackage, instructions.DockerArtifact) - } + return (cmdr.Execute(ctx)) +} - return subcommands.ExitSuccess +type DockerArchiveCmd struct { + targetPackage Package + dockerRepository string + dockerTag string +} + +func (*DockerArchiveCmd) Name() string { return "docker" } +func (*DockerArchiveCmd) Synopsis() string { return "Create a docker image" } +func (*DockerArchiveCmd) Usage() string { + return `` +} + +func (d *DockerArchiveCmd) SetFlags(f *flag.FlagSet) { + f.StringVar(&d.dockerRepository, "repository", "docker-registry.yourbase.io", "Repository base name") + f.StringVar(&d.dockerTag, "tag", "latest", "Container tag") } -//PackageDockerImage will create a push a container image matching the file format below +//Execute will create a container image matching the file format below // -//artifacts: -// docker: -// base_image: ubuntu -// image: dispatcher -// files: -// - dispatcher:dispatcher -// working_dir: / -// exec: /dispatcher -func (b *PackageCmd) PackageDockerImage(targetPackage Package, artifact DockerArtifact) subcommands.ExitStatus { +// package: +// docker: +// base_image: ubuntu +// image: dispatcher +// working_dir: / +// exec: /dispatcher +// artifacts: +// - dispatcher +func (d *DockerArchiveCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { + + instructions := d.targetPackage.Manifest.Package + if instructions.Docker.BaseImage == "" { + log.Errorf("BaseImage is a required field in the configuration") + return subcommands.ExitFailure + } cd := narwhal.ContainerDefinition{ - Image: artifact.BaseImage, - Label: artifact.Image, - WorkDir: artifact.WorkingDir, - Command: artifact.Exec, + Image: instructions.Docker.BaseImage, + WorkDir: instructions.Docker.WorkingDir, + Command: instructions.Docker.Exec, } - file := "" - localFile := "" - // TODO: expand after talking John - // UploadArchive for something like the API - How do we know which files? - if len(artifact.Files) > 0 { - files := strings.SplitN(artifact.Files[0], ":", 2) - localFile = filepath.Join(targetPackage.Path(), files[0]) - file = files[0] + tmpArchiveFile := filepath.Join(d.targetPackage.Path(), fmt.Sprintf("%s-package.tar", d.targetPackage.Name)) + tar := archiver.Tar{MkdirAll: true} + err := tar.Archive(instructions.Artifacts, tmpArchiveFile) + if err != nil { + log.Errorf("Could not create archive: %v\n", err) + return subcommands.ExitFailure } + defer os.Remove(tmpArchiveFile) // Default to yourbase container registry. User can pass in an empty string for local registry - repository := targetPackage.Name - if b.dockerRepository != "" { - repository = fmt.Sprintf("%s/%s", strings.TrimRight(b.dockerRepository, "/"), targetPackage.Name) + repository := d.targetPackage.Name + if d.dockerRepository != "" { + repository = fmt.Sprintf("%s/%s", strings.TrimRight(d.dockerRepository, "/"), d.targetPackage.Name) } - err := narwhal.BuildImageWithFile(cd, repository, b.dockerTag, localFile, file, artifact.WorkingDir) + err = narwhal.BuildImageWithFile(cd, repository, d.dockerTag, tmpArchiveFile, "tmp.tar", instructions.Docker.WorkingDir) if err != nil { log.Error(err) return subcommands.ExitFailure @@ -121,28 +132,45 @@ func (b *PackageCmd) PackageDockerImage(targetPackage Package, artifact DockerAr return subcommands.ExitSuccess } -func (b *PackageCmd) ArchiveWorkspace(targetPackage Package, instructions []string) subcommands.ExitStatus { +type TarArchiveCmd struct { + targetPackage Package + tar_file string +} + +func (*TarArchiveCmd) Name() string { return "tar" } +func (*TarArchiveCmd) Synopsis() string { return "Create a tar file" } +func (*TarArchiveCmd) Usage() string { + return `` +} - outputDir := filepath.Join(targetPackage.BuildRoot(), "output") - MkdirAsNeeded(outputDir) - archiveFile := fmt.Sprintf("%s-package.tar", targetPackage.Name) - pkgFile := filepath.Join(outputDir, archiveFile) +func (t *TarArchiveCmd) SetFlags(f *flag.FlagSet) { + f.StringVar(&t.tar_file, "tar_file", "", "tar file path and name") +} + +func (t *TarArchiveCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { + + if t.tar_file == "" { + outputDir := filepath.Join(t.targetPackage.BuildRoot(), "output") + MkdirAsNeeded(outputDir) + archiveFile := fmt.Sprintf("%s-package.tar", t.targetPackage.Name) + t.tar_file = filepath.Join(outputDir, archiveFile) + } - if PathExists(pkgFile) { - os.Remove(pkgFile) + if PathExists(t.tar_file) { + os.Remove(t.tar_file) } - log.Infof("Generating package file %s...\n", pkgFile) + log.Infof("Generating package file %s...\n", t.tar_file) tar := archiver.Tar{ MkdirAll: true, } - packageDir := targetPackage.Path() + packageDir := t.targetPackage.Path() oldCwd, _ := os.Getwd() _ = os.Chdir(packageDir) - err := tar.Archive(instructions, pkgFile) + err := tar.Archive(t.targetPackage.Manifest.Package.Artifacts, t.tar_file) _ = os.Chdir(oldCwd) if err != nil { diff --git a/go.mod b/go.mod index 15c5fc91..18323db9 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,5 @@ module github.com/yourbase/yb -replace github.com/Sirupsen/logrus => github.com/sirupsen/logrus v1.4.2 - -//replace github.com/yourbase/narwhal => /Users/jewart/Work/narwhal - require ( github.com/Microsoft/hcsshim v0.8.7 // indirect github.com/beholders-eye/diffparser v0.0.0-20190814025112-fcedf0a097ba @@ -17,7 +13,7 @@ require ( github.com/gobwas/ws v1.0.2 github.com/gogo/protobuf v1.3.1 // indirect github.com/golang/snappy v0.0.1 // indirect - github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf + github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/gopherjs/gopherjs v0.0.0-20190915194858-d3ddacdb130f // indirect github.com/johnewart/archiver v3.1.4+incompatible github.com/johnewart/subcommands v0.0.0-20181012225330-46f0354f6315 @@ -31,28 +27,28 @@ require ( github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/matishsiao/goInfo v0.0.0-20170803142006-617e6440957e github.com/morikuni/aec v1.0.0 // indirect - github.com/nwaples/rardecode v1.0.0 // indirect - github.com/pierrec/lz4 v2.3.0+incompatible // indirect + github.com/nwaples/rardecode v1.1.0 // indirect + github.com/pierrec/lz4 v2.4.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/sergi/go-diff v1.1.0 // indirect github.com/sirupsen/logrus v1.4.2 github.com/smartystreets/assertions v1.0.1 // indirect github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect - github.com/ulikunitz/xz v0.5.6 + github.com/ulikunitz/xz v0.5.7 github.com/waigani/diffparser v0.0.0-20190828052634-7391f219313d // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect - github.com/yourbase/narwhal v0.0.0-20200207175229-fecb0f220671 - golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708 - golang.org/x/net v0.0.0-20191112182307-2180aed22343 // indirect + github.com/yourbase/narwhal v0.0.0-20200226183157-748bc33c70c8 + golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d + golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect - golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 // indirect - google.golang.org/genproto v0.0.0-20200205142000-a86caf926a67 // indirect + golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae // indirect + google.golang.org/genproto v0.0.0-20200225123651-fc8f55426688 // indirect google.golang.org/grpc v1.27.1 // indirect - gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect - gopkg.in/ini.v1 v1.51.0 + gopkg.in/ini.v1 v1.52.0 gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect gopkg.in/src-d/go-billy.v4 v4.3.2 gopkg.in/src-d/go-git.v4 v4.13.1 - gopkg.in/yaml.v2 v2.2.5 + gopkg.in/yaml.v2 v2.2.8 ) go 1.13 diff --git a/go.sum b/go.sum index ecc7ebc1..9a56661c 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,7 @@ github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Microsoft/go-winio v0.4.12 h1:xAfWHN1IrQ0NJ9TBC0KBZoqLjzDTr1ML+4MywiUOryc= github.com/Microsoft/go-winio v0.4.12/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= github.com/Microsoft/hcsshim v0.8.7-0.20191101173118-65519b62243c h1:YMP6olTU903X3gxQJckdmiP8/zkSMq4kN3uipsU9XjU= @@ -103,8 +104,8 @@ github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf h1:7+FW5aGwISbqUtkfmIpZJGRgNFg2ioYPvFaUxdqpDsg= -github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf/go.mod h1:RpwtwJQFrIEPstU94h88MWPXP2ektJZ8cZ0YntAmXiE= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190915194858-d3ddacdb130f h1:TyqzGm2z1h3AGhjOoRYyeLcW4WlW81MDQkWa+rx/000= @@ -178,8 +179,8 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= -github.com/nwaples/rardecode v1.0.0 h1:r7vGuS5akxOnR4JQSkko62RJ1ReCMXxQRPtxsiFMBOs= -github.com/nwaples/rardecode v1.0.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= +github.com/nwaples/rardecode v1.1.0 h1:vSxaY8vQhOcVr4mm5e8XllHWTiM4JF507A0Katqw7MQ= +github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -193,8 +194,8 @@ github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.m github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= github.com/pelletier/go-buffruneio v0.2.0 h1:U4t4R6YkofJ5xHm3dJzuRpPZ0mr5MMCoAWooScCR7aA= github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= -github.com/pierrec/lz4 v2.3.0+incompatible h1:CZzRn4Ut9GbUkHlQ7jqBXeZQV41ZSKWFc302ZU6lUTk= -github.com/pierrec/lz4 v2.3.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.4.1+incompatible h1:mFe7ttWaflA46Mhqh+jUfjp2qTbPYxLB2/OyBppH9dg= +github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -205,6 +206,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME= github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= @@ -230,6 +233,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/ulikunitz/xz v0.5.6 h1:jGHAfXawEGZQ3blwU5wnWKQJvAraT7Ftq9EXjnXYgt8= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/ulikunitz/xz v0.5.7 h1:YvTNdFzX6+W5m9msiYg/zpkSURPPtOlzbqYjrFn7Yt4= +github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/waigani/diffparser v0.0.0-20190810221810-79c8f4e68fb4 h1:5JA4mMkQVtcQs/ZZcx57GL7sHRXS6TLPs77WkRqsmRk= github.com/waigani/diffparser v0.0.0-20190810221810-79c8f4e68fb4/go.mod h1:CefseIIgCUqtn0B83Lc3+8F2L1V9viokWY2GQlkWGfs= @@ -244,6 +249,8 @@ github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofm github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/yourbase/narwhal v0.0.0-20200207175229-fecb0f220671 h1:RB+Z2qLSVHjGznoFlSQzfPWk4+NsEIhs3Dy9CiEIiaY= github.com/yourbase/narwhal v0.0.0-20200207175229-fecb0f220671/go.mod h1:iZP/RlitkX0oZU3PAU1hGbxdkJbwNoXirCtsquN8Zfs= +github.com/yourbase/narwhal v0.0.0-20200226183157-748bc33c70c8 h1:8CkfYbZUUNrklOaGbONn2BljFjJP7Eym1hCuepB6uvE= +github.com/yourbase/narwhal v0.0.0-20200226183157-748bc33c70c8/go.mod h1:iZP/RlitkX0oZU3PAU1hGbxdkJbwNoXirCtsquN8Zfs= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= golang.org/x/crypto v0.0.0-20160824173033-351dc6a5bf92/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -255,8 +262,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49N golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708 h1:pXVtWnwHkrWD9ru3sDxY/qFK/bfc0egRovX91EjWjf4= -golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAakHVhecoE5wlSg5GjnafJGw= +golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -280,8 +287,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 h1:Ao/3l156eZf2AW5wK8a7/smtodRU+gha3+BeqJ69lRk= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343 h1:00ohfJ4K98s3m6BGUoBd8nyfp4Yl0GoIKvw5abItTjI= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -302,12 +309,13 @@ golang.org/x/sys v0.0.0-20190310054646-10058d7d4faa/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e h1:D5TXcfTk7xF7hvieo4QErS3qqCB4teTffacDWr7CI+0= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -330,8 +338,8 @@ google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200205142000-a86caf926a67 h1:MBO9fkVSrTpJ8vgHLPi5gb+ZWXEy7/auJN8yqyu9EiE= -google.golang.org/genproto v0.0.0-20200205142000-a86caf926a67/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200225123651-fc8f55426688 h1:1+0Z5cgv1eDXJD9z2tdQF9PSSQnJXwism490hJydMRI= +google.golang.org/genproto v0.0.0-20200225123651-fc8f55426688/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -346,8 +354,8 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.52.0 h1:j+Lt/M1oPPejkniCg1TkWE2J3Eh1oZTsHSXzMTzUXn4= +gopkg.in/ini.v1 v1.52.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20150529124711-01ee097136da h1:k2jXxOPVI4OLmisXza2wym08Pz6x+ky/f71oJBuA8zg= gopkg.in/mgo.v2 v2.0.0-20150529124711-01ee097136da/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= @@ -363,8 +371,9 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN gopkg.in/yaml.v2 v2.0.0-20160715033755-e4d366fc3c79/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/workspace/build_manifest.go b/workspace/build_manifest.go index 4388f60d..84d8d8d1 100644 --- a/workspace/build_manifest.go +++ b/workspace/build_manifest.go @@ -26,16 +26,15 @@ type CIBuild struct { } type PackagePhase struct { - DockerArtifact DockerArtifact `yaml:"docker"` - Artifacts []string `yaml:"archive"` + Artifacts []string `yaml:"artifacts"` + Docker DockerArchive `yaml:"docker"` + Tar map[string]string `yaml:"tar"` } -type DockerArtifact struct { - BaseImage string `yaml:"base_image"` - Image string `yaml:"image"` - Files []string `yaml:"files"` - WorkingDir string `yaml:"working_dir"` - Exec string `yaml:"exec"` +type DockerArchive struct { + BaseImage string `yaml:"base_image"` + WorkingDir string `yaml:"working_dir"` + Exec string `yaml:"exec"` } type DependencySet struct { @@ -117,7 +116,7 @@ type BuildManifest struct { BuildTargets []BuildTarget `yaml:"build_targets"` Build BuildTarget `yaml:"build"` Exec ExecPhase `yaml:"exec"` - Package PackagePhase `yaml:"artifacts"` + Package PackagePhase `yaml:"package"` CI CIInfo `yaml:"ci"` }