Merge pull request #1201 from kpacha/fix_marathon_upgrade

Fix Marathon deployments
This commit is contained in:
Brad Rydzewski 2015-09-16 14:29:57 -07:00
commit f0296c7149

View file

@ -10,6 +10,7 @@ import (
type Marathon struct { type Marathon struct {
//Hostname for the Marathon Master //Hostname for the Marathon Master
Host string `yaml:"host,omitempty"` Host string `yaml:"host,omitempty"`
App string `yaml:"app,omitempty"`
// The app config for marathon // The app config for marathon
//https://mesosphere.github.io/marathon/docs/rest-api.html#post-v2-apps //https://mesosphere.github.io/marathon/docs/rest-api.html#post-v2-apps
@ -26,12 +27,13 @@ func (m *Marathon) Write(f *buildfile.Buildfile) {
// debugging purposes so we can see if / where something is failing // debugging purposes so we can see if / where something is failing
f.WriteCmdSilent("echo 'deploying to Marathon ...'") f.WriteCmdSilent("echo 'deploying to Marathon ...'")
post := fmt.Sprintf( put := fmt.Sprintf(
"curl -X POST -d @%s http://%s/v2/apps --header \"Content-Type:application/json\"", "curl -X PUT -d @%s http://%s/v2/apps/%s --header \"Content-Type:application/json\"",
m.ConfigFile, m.ConfigFile,
m.App,
m.Host, m.Host,
) )
f.WriteCmdSilent(post) f.WriteCmdSilent(put)
} }
func (m *Marathon) GetCondition() *condition.Condition { func (m *Marathon) GetCondition() *condition.Condition {