Add data from crafting-guide

This commit is contained in:
Andrew Miner
2015-04-27 14:37:18 -07:00
parent 52ac468498
commit 67d0199e2d
4981 changed files with 27122 additions and 2 deletions
Executable
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
export AWS_CONFIG_FILE="aws.config"
ROOT="./data"
SITE="crafting-guide.com"
TARGET=""
while [[ "$1" != "" ]]; do
case "$1" in
"--new") TARGET="new";;
"--promote") TARGET="promote";;
esac
shift
done
if [[ "$TARGET" == "" ]]; then
echo "Please choose either --new or --promote for the target."
exit
fi
if [[ "$TARGET" == "new" ]]; then
find "$ROOT" -name ".DS_Store" 2>/dev/null | xargs rm &>/dev/null
if grunt test; then
echo "Preparing to upload to S3..."
s3cmd sync -r --add-header="cache-control:max-age=1800" "$ROOT/" "s3://new.$SITE/data/"
fi
elif [[ "$TARGET" == "promote" ]]; then
aws s3 sync "s3://new.$SITE" "s3://$SITE" --delete
fi