From 3d87275c09799aba37be62faeccaeea6a90a5201 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 20 Oct 2018 15:13:31 -0300 Subject: [PATCH] fix: allow to publish snaps --- internal/pipe/snapcraft/snapcraft.go | 3 +++ pkg/config/config.go | 1 + 2 files changed, 4 insertions(+) diff --git a/internal/pipe/snapcraft/snapcraft.go b/internal/pipe/snapcraft/snapcraft.go index b744c83ee..b346408c1 100644 --- a/internal/pipe/snapcraft/snapcraft.go +++ b/internal/pipe/snapcraft/snapcraft.go @@ -193,6 +193,9 @@ func create(ctx *context.Context, arch string, binaries []artifact.Artifact) err if out, err = cmd.CombinedOutput(); err != nil { return fmt.Errorf("failed to generate snap package: %s", string(out)) } + if !ctx.Config.Snapcraft.Publish { + return nil + } ctx.Artifacts.Add(artifact.Artifact{ Type: artifact.PublishableSnapcraft, Name: folder + ".snap", diff --git a/pkg/config/config.go b/pkg/config/config.go index dbeeceb8c..512cce340 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -217,6 +217,7 @@ type SnapcraftAppMetadata struct { type Snapcraft struct { NameTemplate string `yaml:"name_template,omitempty"` Replacements map[string]string `yaml:",omitempty"` + Publish bool `yaml:",omitempty"` Name string `yaml:",omitempty"` Summary string `yaml:",omitempty"`