Skip to content

Instantly share code, notes, and snippets.

@jlrigau
Last active August 29, 2015 14:27
Show Gist options
  • Save jlrigau/35b9fcc20833d6af5e1a to your computer and use it in GitHub Desktop.
Save jlrigau/35b9fcc20833d6af5e1a to your computer and use it in GitHub Desktop.
How to update service configuration and restart a service on Marathon?
MARATHON_BASE_URL=http://[REPLACE_IT]:8080
VERSION=$(curl -X PUT -H "Content-Type: application/json" $MARATHON_BASE_URL/v2/apps/dashboard?force=true -d@dashboard.json | jq '.version' | tr -d '"')
if [ $(curl -sL -w "%{http_code}" $MARATHON_BASE_URL/v2/apps/dashboard/versions/$VERSION -o /dev/null) != 200 ]; then
curl -X POST $MARATHON_BASE_URL/v2/apps/dashboard/restart?force=true
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment