Browse Source

fix: add syntax only flag

update-packer-186
Bo-Yi Wu 7 years ago
parent
commit
b6a8901ebb
  1. 6
      main.go
  2. 1
      plugin.go

6
main.go

@ -50,6 +50,11 @@ func main() {
Usage: "Will execute multiple builds in parallel as defined in the template", Usage: "Will execute multiple builds in parallel as defined in the template",
EnvVar: "PLUGIN_TEMPLATE", EnvVar: "PLUGIN_TEMPLATE",
}, },
cli.BoolFlag{
Name: "syntax_only",
Usage: "Only check syntax. Do not verify config of the template",
EnvVar: "PLUGIN_SYNTAX_ONLY",
},
} }
app.Version = Version app.Version = Version
@ -89,6 +94,7 @@ func run(c *cli.Context) error {
VarFiles: c.StringSlice("var_files"), VarFiles: c.StringSlice("var_files"),
Except: c.StringSlice("except"), Except: c.StringSlice("except"),
Only: c.StringSlice("only"), Only: c.StringSlice("only"),
SyntaxOnly: c.Bool("syntax_only"),
}, },
} }

1
plugin.go

@ -74,7 +74,6 @@ func (p *Plugin) Exec() error {
commands = append(commands, exec.Command("packer", "version")) commands = append(commands, exec.Command("packer", "version"))
logrus.Println(p.Config.Actions)
// Add commands listed from Actions // Add commands listed from Actions
for _, action := range p.Config.Actions { for _, action := range p.Config.Actions {
switch action { switch action {

Loading…
Cancel
Save