Commit 2e4dd639 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

template: parse push

parent 43fbd26d
......@@ -174,6 +174,17 @@ func (r *rawTemplate) Template() (*Template, error) {
result.Provisioners = append(result.Provisioners, &p)
}
// Push
if len(r.Push) > 0 {
var p Push
if err := r.decoder(&p, nil).Decode(r.Push); err != nil {
errs = multierror.Append(errs, fmt.Errorf(
"push: %s", err))
}
result.Push = &p
}
// If we have errors, return those with a nil result
if errs != nil {
return nil, errs
......
......@@ -259,6 +259,16 @@ func TestParse(t *testing.T) {
},
false,
},
{
"parse-push.json",
&Template{
Push: &Push{
Name: "foo",
},
},
false,
},
}
for _, tc := range cases {
......
{
"push": {
"name": "foo"
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment