Created
April 15, 2017 14:54
-
-
Save iSkore/789c96ca030d13bcee69d808ce700264 to your computer and use it in GitHub Desktop.
Publish folder 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
# Usage: `s3publish bucket-name default-profile` | |
# BUCKET to upload to | |
BUCKET=s3://$1 | |
# Optional profile | |
PROFILE=$2 | |
# specify folders if thou so choose | |
ENV=/ | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
echo "LOADING - PLEASE BE PATIENT..." | |
aws s3 sync \ | |
$DIR/ \ | |
$BUCKET$ENV \ | |
--delete \ | |
--quiet \ | |
--exclude "*$0*" \ | |
--exclude "*.git*" \ | |
--exclude "*.DS_Store*" \ | |
--exclude "*.DS_Store" \ | |
--exclude ".DS_Store" \ | |
--exclude "*/.DS_Store*" \ | |
--exclude "*/.DS_Store" \ | |
--exclude "__MACOSX__" \ | |
--exclude "./__MACOSX__" \ | |
--exclude "*/__MACOSX__" \ | |
--exclude "*/__MACOSX__*" \ | |
--exclude "*.idea*" \ | |
--exclude "*.tmp*" \ | |
--exclude "*.tags*" \ | |
--exclude "*.tags1*" \ | |
--exclude "*.log*" \ | |
--exact-timestamps \ | |
--profile $PROFILE | |
echo -ne '\n' | |
echo '' | |
echo "ASSETS PUBLISHED" | |
echo " FROM [ $DIR/ ]" | |
echo " TO [ $BUCKET ]" | |
echo '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment