1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

fix: docker manifest on draft release (#2119)

docker manifests exepcted to be pushed on draft.

- add test for such case

Signed-off-by: Dinar Valeev <dinar.valeev@absa.africa>
This commit is contained in:
Dinar Valeev 2021-03-19 14:24:50 +01:00 committed by GitHub
parent 0e689b414a
commit 57a69dbe47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -155,9 +155,6 @@ func process(ctx *context.Context, docker config.Docker, artifacts []*artifact.A
if ctx.SkipPublish {
return pipe.ErrSkipPublishEnabled
}
if ctx.Config.Release.Draft {
return pipe.Skip("release is marked as draft")
}
if strings.TrimSpace(docker.SkipPush) == "auto" && ctx.Semver.Prerelease != "" {
return pipe.Skip("prerelease detected with 'auto' push, skipping docker publish")
}

View File

@ -1002,6 +1002,18 @@ func TestDefaultDockerfile(t *testing.T) {
require.Equal(t, "Dockerfile", ctx.Config.Dockers[1].Dockerfile)
}
func TestDraftRelease(t *testing.T) {
var ctx = &context.Context{
Config: config.Project{
Release: config.Release{
Draft: true,
},
},
}
require.False(t, pipe.IsSkip(Pipe{}.Publish(ctx)))
}
func TestDefaultNoDockers(t *testing.T) {
var ctx = &context.Context{
Config: config.Project{