From bf6b6fe9f8be3542b724cf7ef373d2875e968d78 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 14 Sep 2017 19:38:48 -0300 Subject: [PATCH 1/2] fixed docker version name when snapshots --- pipeline/docker/docker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline/docker/docker.go b/pipeline/docker/docker.go index a1343a336..cb9a84d3d 100644 --- a/pipeline/docker/docker.go +++ b/pipeline/docker/docker.go @@ -61,7 +61,7 @@ func (Pipe) Run(ctx *context.Context) error { func doRun(ctx *context.Context, folder string, docker config.Docker, binary context.Binary) error { var root = filepath.Join(ctx.Config.Dist, folder) var dockerfile = filepath.Join(root, filepath.Base(docker.Dockerfile)) - var image = fmt.Sprintf("%s:%s", docker.Image, ctx.Git.CurrentTag) + var image = fmt.Sprintf("%s:%s", docker.Image, ctx.Version) if err := os.Link(docker.Dockerfile, dockerfile); err != nil { return errors.Wrap(err, "failed to link dockerfile") From f4c79826da0d0d9a30c8f55d88573e62d5f055a0 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 14 Sep 2017 19:41:55 -0300 Subject: [PATCH 2/2] tests updated --- pipeline/docker/docker_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pipeline/docker/docker_test.go b/pipeline/docker/docker_test.go index 47aea0cdc..76ecbb96c 100644 --- a/pipeline/docker/docker_test.go +++ b/pipeline/docker/docker_test.go @@ -27,9 +27,7 @@ func TestRunPipe(t *testing.T) { // this might fail as the image doesnt exist yet, so lets ignore the error _ = exec.Command("docker", "rmi", "goreleaser/test_run_pipe:v1.0.0").Run() var ctx = &context.Context{ - Git: context.GitInfo{ - CurrentTag: "v1.0.0", - }, + Version: "1.0.0", Publish: true, Config: config.Project{ ProjectName: "mybin", @@ -59,12 +57,12 @@ func TestRunPipe(t *testing.T) { // this might should not fail as the image should have been created when // the step ran assert.NoError( - exec.Command("docker", "rmi", "goreleaser/test_run_pipe:v1.0.0").Run(), + exec.Command("docker", "rmi", "goreleaser/test_run_pipe:1.0.0").Run(), ) // the test_run_pipe_nope image should not have been created, so deleting // it should fail assert.Error( - exec.Command("docker", "rmi", "goreleaser/test_run_pipe_nope:v1.0.0").Run(), + exec.Command("docker", "rmi", "goreleaser/test_run_pipe_nope:1.0.0").Run(), ) }