remove any reference to Push

This commit is contained in:
Adrien Delorme 2019-09-16 16:30:29 +02:00
parent 4d4bd38afa
commit 3b8f3c5a8b
6 changed files with 0 additions and 77 deletions

View File

@ -398,10 +398,5 @@ func (c *Core) init() error {
c.secrets = append(c.secrets, secret)
}
// Interpolate the push configuration
if _, err := interpolate.RenderInterface(&c.Template.Push, c.Context()); err != nil {
return fmt.Errorf("Error interpolating 'push': %s", err)
}
return nil
}

View File

@ -427,40 +427,6 @@ func TestCoreBuild_templatePath(t *testing.T) {
}
}
func TestCore_pushInterpolate(t *testing.T) {
cases := []struct {
File string
Vars map[string]string
Result template.Push
}{
{
"push-vars.json",
map[string]string{"foo": "bar"},
template.Push{Name: "bar"},
},
}
for _, tc := range cases {
tpl, err := template.ParseFile(fixtureDir(tc.File))
if err != nil {
t.Fatalf("err: %s\n\n%s", tc.File, err)
}
core, err := NewCore(&CoreConfig{
Template: tpl,
Variables: tc.Vars,
})
if err != nil {
t.Fatalf("err: %s\n\n%s", tc.File, err)
}
expected := core.Template.Push
if !reflect.DeepEqual(expected, tc.Result) {
t.Fatalf("err: %s\n\n%#v", tc.File, expected)
}
}
}
func TestCoreValidate(t *testing.T) {
cases := []struct {
File string

View File

@ -242,17 +242,6 @@ 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

View File

@ -358,15 +358,6 @@ func TestParse(t *testing.T) {
false,
},
{
"parse-push.json",
&Template{
Push: Push{
Name: "foo",
},
},
false,
},
{
"parse-comment.json",
&Template{
@ -480,9 +471,6 @@ func TestParse(t *testing.T) {
},
},
},
Push: Push{
Name: "push test",
},
},
false,
},

View File

@ -25,7 +25,6 @@ type Template struct {
Builders map[string]*Builder
Provisioners []*Provisioner
PostProcessors [][]*PostProcessor
Push Push
// RawContents is just the raw data for this template
RawContents []byte
@ -66,15 +65,6 @@ func (t *Template) Raw() (*rawTemplate, error) {
out.Variables[k] = v
}
if t.Push.Name != "" {
b, _ := json.Marshal(t.Push)
var m map[string]interface{}
_ = json.Unmarshal(b, &m)
out.Push = m
}
return &out, nil
}

View File

@ -1,5 +0,0 @@
{
"push": {
"name": "foo"
}
}