|
|
|
|
@ -34,6 +34,7 @@ type pushUploadFn func(
|
|
|
|
|
func (c *PushCommand) Run(args []string) int {
|
|
|
|
|
var token string
|
|
|
|
|
var message string
|
|
|
|
|
var name string
|
|
|
|
|
var create bool
|
|
|
|
|
|
|
|
|
|
f := flag.NewFlagSet("push", flag.ContinueOnError)
|
|
|
|
|
@ -41,6 +42,7 @@ func (c *PushCommand) Run(args []string) int {
|
|
|
|
|
f.StringVar(&token, "token", "", "token")
|
|
|
|
|
f.StringVar(&message, "m", "", "message")
|
|
|
|
|
f.StringVar(&message, "message", "", "message")
|
|
|
|
|
f.StringVar(&name, "name", "", "name")
|
|
|
|
|
f.BoolVar(&create, "create", false, "create (deprecated)")
|
|
|
|
|
if err := f.Parse(args); err != nil {
|
|
|
|
|
return 1
|
|
|
|
|
@ -65,11 +67,17 @@ func (c *PushCommand) Run(args []string) int {
|
|
|
|
|
return 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If we didn't pass name from the CLI, use the template
|
|
|
|
|
if name == "" {
|
|
|
|
|
name = tpl.Push.Name
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Validate some things
|
|
|
|
|
if tpl.Push == nil || tpl.Push.Name == "" {
|
|
|
|
|
if name == "" {
|
|
|
|
|
c.Ui.Error(fmt.Sprintf(
|
|
|
|
|
"The 'push' section must be specified in the template with\n" +
|
|
|
|
|
"at least the 'name' option set."))
|
|
|
|
|
"at least the 'name' option set. Alternatively, you can pass the\n" +
|
|
|
|
|
"name parameter from the CLI."))
|
|
|
|
|
return 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -245,6 +253,9 @@ Options:
|
|
|
|
|
-m, -message=<detail> A message to identify the purpose or changes in this
|
|
|
|
|
Packer template much like a VCS commit message
|
|
|
|
|
|
|
|
|
|
-name=<name> The destination build in Atlas. This is in a format
|
|
|
|
|
"username/name".
|
|
|
|
|
|
|
|
|
|
-token=<token> The access token to use to when uploading
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|