Created
June 10, 2016 15:09
-
-
Save dandelauro/f387e71bd7f0e8b24cd862bcc1a6dccf to your computer and use it in GitHub Desktop.
Bash script to copy files to S3
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
repo=$(basename "$PWD") | |
branch=$(git symbolic-ref --short -q HEAD) | |
aws s3 cp public/ s3://happycog-static/$repo/$branch --recursive --acl=public-read | |
if [[ "$branch" = "master" ]]; then | |
url="http://$obj.cogclient.com" | |
else | |
url="http://$branch.$repo.cogclient.com" | |
fi | |
slackText="$repo: $branch branch was just deployed to $url" | |
curl -X POST --data-urlencode "payload={\"text\": \"$slackText\"}" https://hooks.slack.com/services/XXXXXXXXXX/XXXXXXXXXX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment