Skip to content

Instantly share code, notes, and snippets.

@sirtimbly
Created March 5, 2020 15:53
Show Gist options
  • Save sirtimbly/c09a68e983cde372ab25d9a215fa353d to your computer and use it in GitHub Desktop.
Save sirtimbly/c09a68e983cde372ab25d9a215fa353d to your computer and use it in GitHub Desktop.
Heroku Deploy a Slug from One App to Another
curl -i -n -X GET https://api.heroku.com/apps/$STAGING_APP_NAME/releases \ system
-H "Accept: application/vnd.heroku+json; version=3;" -H "Range: version ..; order=desc"
# EXTRACT THE SLUG ID OUT OF THAT JSON OBJECT
# RELEASE THAT SLUG
curl -X POST -H "Accept: application/vnd.heroku+json; version=3" -n \ system
-H "Content-Type: application/json" \
-d '{"slug": "$SLUG_ID"}' \
https://api.heroku.com/apps/$PROD_APP_NAME/releases
# RESTART ALL DYNOS
curl -n -X DELETE https://api.heroku.com/apps/$PROD_APP_NAME/dynos \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.heroku+json; version=3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment