Last active
November 3, 2016 16:08
-
-
Save smailq/0e69669007ed32e329a0ceb2e5969f6d to your computer and use it in GitHub Desktop.
Build and run newly built image
This file contains hidden or 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/bash | |
# Get current git sha | |
GIT_COMMIT=$(git rev-parse HEAD) | |
# Build docker image, then stop exisitng container, then run new container | |
make build; make stop; make run; | |
# Report to Slack about deployment | |
curl -s -X POST --data-urlencode 'payload={"channel": "#dev-ops", "username": "Staging Server", "text": "Commit '$GIT_COMMIT' has been pushed to http://some-project-home.com", "icon_emoji": ":floppy_disk:"}' https://hooks.slack.com/[slack-hook-url] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment