From cc61a7dfb87e8aefa9e35f8e9169a6076bcf15d5 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 3 Dec 2014 14:04:01 -0600 Subject: [PATCH] command/push: warn for bad builds --- command/push.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/command/push.go b/command/push.go index c59c6cab9..edabe8297 100644 --- a/command/push.go +++ b/command/push.go @@ -147,6 +147,26 @@ func (c *PushCommand) Run(args []string) int { uploadOpts.Builds[b.Name] = info } + // Warn about builds not having post-processors. + var badBuilds []string + for name, b := range uploadOpts.Builds { + if b.Artifact { + continue + } + + badBuilds = append(badBuilds, name) + } + if len(badBuilds) > 0 { + c.Ui.Error(fmt.Sprintf( + "Warning! One or more of the builds in this template does not\n" + + "have an Atlas post-processor. Artifacts from this template will\n" + + "not appear in the Atlas artifact registry.\n\n" + + "This is just a warning. Atlas will still build your template\n" + + "and assume other post-processors are sending the artifacts where\n" + + "they need to go.\n\n" + + "Builds: %s\n\n", strings.Join(badBuilds, ", "))) + } + // Create the build config if it doesn't currently exist. if err := c.create(uploadOpts.Slug, create); err != nil { c.Ui.Error(err.Error())