mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
fix: docker: skip push skips other builds (#1177)
* fix: skip aware semerrgroup Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: docker: skip push skips other builds Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
parent
d338cf7285
commit
792b883f59
@ -80,7 +80,7 @@ func (Pipe) Publish(ctx *context.Context) error {
|
||||
}
|
||||
|
||||
func doRun(ctx *context.Context) error {
|
||||
var g = semerrgroup.New(ctx.Parallelism)
|
||||
var g = semerrgroup.NewSkipAware(semerrgroup.New(ctx.Parallelism))
|
||||
for _, docker := range ctx.Config.Dockers {
|
||||
docker := docker
|
||||
g.Go(func() error {
|
||||
|
@ -232,6 +232,35 @@ func TestRunPipe(t *testing.T) {
|
||||
assertImageLabels: noLabels,
|
||||
assertError: testlib.AssertSkipped,
|
||||
},
|
||||
"one_img_error_with_skip_push": {
|
||||
dockers: []config.Docker{
|
||||
{
|
||||
ImageTemplates: []string{
|
||||
registry + "goreleaser/one_img_error_with_skip_push:true",
|
||||
},
|
||||
Goos: "linux",
|
||||
Goarch: "amd64",
|
||||
Dockerfile: "testdata/Dockerfile.true",
|
||||
Binaries: []string{"mybin"},
|
||||
SkipPush: "true",
|
||||
},
|
||||
{
|
||||
ImageTemplates: []string{
|
||||
registry + "goreleaser/one_img_error_with_skip_push:false",
|
||||
},
|
||||
Goos: "linux",
|
||||
Goarch: "amd64",
|
||||
Dockerfile: "testdata/Dockerfile.false",
|
||||
Binaries: []string{"mybin"},
|
||||
SkipPush: "true",
|
||||
},
|
||||
},
|
||||
expect: []string{
|
||||
registry + "goreleaser/one_img_error_with_skip_push:true",
|
||||
},
|
||||
assertImageLabels: noLabels,
|
||||
assertError: shouldErr("failed to build docker image"),
|
||||
},
|
||||
"valid_no_latest": {
|
||||
dockers: []config.Docker{
|
||||
{
|
||||
@ -531,6 +560,7 @@ func TestRunPipe(t *testing.T) {
|
||||
Dist: dist,
|
||||
Dockers: docker.dockers,
|
||||
})
|
||||
ctx.Parallelism = 1
|
||||
ctx.Env = docker.env
|
||||
ctx.Version = "1.0.0"
|
||||
ctx.Git = context.GitInfo{
|
||||
|
2
internal/pipe/docker/testdata/Dockerfile.false
vendored
Normal file
2
internal/pipe/docker/testdata/Dockerfile.false
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
FROM alpine
|
||||
RUN false
|
2
internal/pipe/docker/testdata/Dockerfile.true
vendored
Normal file
2
internal/pipe/docker/testdata/Dockerfile.true
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
FROM alpine
|
||||
RUN true
|
Loading…
x
Reference in New Issue
Block a user