From 2ffd6274b7e9be0df0adc10dd7f04aca8644d573 Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Sun, 28 Dec 2014 17:35:58 -0800 Subject: [PATCH] Update deploy to use new S3 setup --- scripts/deploy | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/scripts/deploy b/scripts/deploy index 4e2ef8d0f..fa0bc95f8 100755 --- a/scripts/deploy +++ b/scripts/deploy @@ -1,3 +1,26 @@ #!/bin/bash -aws s3 sync html/ s3://crafting-guide.com/ +export AWS_CONFIG_FILE="$HOME/Documents/CraftingGuide/aws.config" + +ROOT="./dist" +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" | xargs rm + aws s3 sync $ROOT s3://new.$SITE --delete +elif [[ "$TARGET" == "promote" ]]; then + aws s3 sync s3://new.$SITE s3://$SITE --delete +fi