* Change all internal links to use URLs ending in `/` * Add the prerender script which uses PhantomJS to pre-render the HTML for all possible pages in the system * Change the build process to incorporate the pre-rendered files * Update the sitemap script to generate the new URLs
29 lines
707 B
Bash
Executable File
29 lines
707 B
Bash
Executable File
#!/bin/bash
|
|
|
|
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
|
|
grunt clean dist
|
|
s3cmd sync -r --delete-removed --add-header="cache-control:max-age=1800" "$ROOT/" "s3://new.$SITE/"
|
|
grunt clean build
|
|
elif [[ "$TARGET" == "promote" ]]; then
|
|
aws s3 sync "s3://new.$SITE" "s3://$SITE" --delete
|
|
fi
|