You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-11-06 09:09:29 +02:00
feat: add --skip-docker (#3176)
Allow to skip the entire docker images and manifests builds. Might be useful for faster local builds et al. closes #3144 Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
f1c611b21b
commit
ae399220ef
@@ -31,7 +31,7 @@ const (
|
||||
type Pipe struct{}
|
||||
|
||||
func (Pipe) String() string { return "docker images" }
|
||||
func (Pipe) Skip(ctx *context.Context) bool { return len(ctx.Config.Dockers) == 0 }
|
||||
func (Pipe) Skip(ctx *context.Context) bool { return len(ctx.Config.Dockers) == 0 || ctx.SkipDocker }
|
||||
|
||||
// Default sets the pipe defaults.
|
||||
func (Pipe) Default(ctx *context.Context) error {
|
||||
|
||||
@@ -1372,6 +1372,12 @@ func TestSkip(t *testing.T) {
|
||||
require.True(t, Pipe{}.Skip(context.New(config.Project{})))
|
||||
})
|
||||
|
||||
t.Run("skip docker", func(t *testing.T) {
|
||||
ctx := context.New(config.Project{})
|
||||
ctx.SkipDocker = true
|
||||
require.True(t, Pipe{}.Skip(ctx))
|
||||
})
|
||||
|
||||
t.Run("dont skip", func(t *testing.T) {
|
||||
ctx := context.New(config.Project{
|
||||
Dockers: []config.Docker{{}},
|
||||
@@ -1385,6 +1391,12 @@ func TestSkip(t *testing.T) {
|
||||
require.True(t, ManifestPipe{}.Skip(context.New(config.Project{})))
|
||||
})
|
||||
|
||||
t.Run("skip docker", func(t *testing.T) {
|
||||
ctx := context.New(config.Project{})
|
||||
ctx.SkipDocker = true
|
||||
require.True(t, ManifestPipe{}.Skip(ctx))
|
||||
})
|
||||
|
||||
t.Run("dont skip", func(t *testing.T) {
|
||||
ctx := context.New(config.Project{
|
||||
DockerManifests: []config.DockerManifest{{}},
|
||||
|
||||
@@ -19,8 +19,10 @@ import (
|
||||
// allowing to publish multi-arch docker images.
|
||||
type ManifestPipe struct{}
|
||||
|
||||
func (ManifestPipe) String() string { return "docker manifests" }
|
||||
func (ManifestPipe) Skip(ctx *context.Context) bool { return len(ctx.Config.DockerManifests) == 0 }
|
||||
func (ManifestPipe) String() string { return "docker manifests" }
|
||||
func (ManifestPipe) Skip(ctx *context.Context) bool {
|
||||
return len(ctx.Config.DockerManifests) == 0 || ctx.SkipDocker
|
||||
}
|
||||
|
||||
// Default sets the pipe defaults.
|
||||
func (ManifestPipe) Default(ctx *context.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user