Skip to content

Instantly share code, notes, and snippets.

@dandelauro
Created June 10, 2016 15:09
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 dandelauro/f387e71bd7f0e8b24cd862bcc1a6dccf to your computer and use it in GitHub Desktop.
Save dandelauro/f387e71bd7f0e8b24cd862bcc1a6dccf to your computer and use it in GitHub Desktop.
Bash script to copy files to S3
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