From 45b3f3cf7942eb0f3505039397b3b25308978add Mon Sep 17 00:00:00 2001 From: Kpacha Date: Tue, 15 Sep 2015 19:54:39 +0200 Subject: [PATCH 1/2] use PUT method instead POST --- plugin/deploy/marathon/marathon.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugin/deploy/marathon/marathon.go b/plugin/deploy/marathon/marathon.go index b55000a68..7e80a822d 100644 --- a/plugin/deploy/marathon/marathon.go +++ b/plugin/deploy/marathon/marathon.go @@ -10,6 +10,7 @@ import ( type Marathon struct { //Hostname for the Marathon Master Host string `yaml:"host,omitempty"` + App string `yaml:"app,omitempty"` // The app config for marathon //https://mesosphere.github.io/marathon/docs/rest-api.html#post-v2-apps @@ -26,14 +27,15 @@ func (m *Marathon) Write(f *buildfile.Buildfile) { // debugging purposes so we can see if / where something is failing f.WriteCmdSilent("echo 'deploying to Marathon ...'") - post := fmt.Sprintf( - "curl -X POST -d @%s http://%s/v2/apps --header \"Content-Type:application/json\"", + put := fmt.Sprintf( + "curl -X PUT -d @%s http://%s/v2/apps/%s --header \"Content-Type:application/json\"", m.ConfigFile, + m.App, m.Host, ) - f.WriteCmdSilent(post) + f.WriteCmdSilent(put) } func (m *Marathon) GetCondition() *condition.Condition { return m.Condition -} +} \ No newline at end of file From 4d08b918657b39a380857f8983b3006fe99248d2 Mon Sep 17 00:00:00 2001 From: Kpacha Date: Wed, 16 Sep 2015 19:43:37 +0200 Subject: [PATCH 2/2] go fmt --- plugin/deploy/marathon/marathon.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/deploy/marathon/marathon.go b/plugin/deploy/marathon/marathon.go index 7e80a822d..b24be68fc 100644 --- a/plugin/deploy/marathon/marathon.go +++ b/plugin/deploy/marathon/marathon.go @@ -38,4 +38,4 @@ func (m *Marathon) Write(f *buildfile.Buildfile) { func (m *Marathon) GetCondition() *condition.Condition { return m.Condition -} \ No newline at end of file +}