Skip to content

Instantly share code, notes, and snippets.

@gunar
Last active November 5, 2018 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gunar/acb6a5ec37ada7091a80faef33f87c7f to your computer and use it in GitHub Desktop.
Save gunar/acb6a5ec37ada7091a80faef33f87c7f to your computer and use it in GitHub Desktop.
release_heroku_image.sh
#!/bin/sh
http_code=$(curl -s -o out.json -w '%{http_code}' -n -X PATCH https://api.heroku.com/apps/$HEROKU_APP_NAME/formation \
-d "{
\"updates\": [
{
\"type\": \"web\",
\"docker_image\": \"$IMAGE_ID\"
}
]
}" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.heroku+json; version=3.docker-releases" \
-H "Authorization: Bearer $HEROKU_API_KEY" \
;)
# Display output on the screen
cat out.json
if [[ $http_code -eq 200 ]]; then
echo "****** Image successfully relased (Heroku)"
exit 0
fi
echo "****** There was an error when trying to release the image"
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment