Last active
November 5, 2018 18:57
-
-
Save gunar/acb6a5ec37ada7091a80faef33f87c7f to your computer and use it in GitHub Desktop.
release_heroku_image.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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