fix cdn paths, add static error page

This commit is contained in:
Brandon Thomas committed 2016-11-06 05:05:22 -05:00
1 parent 6841ac7783
commit 5c6cd281c4
2 files changed
+14 -3

No files matched your search

+4 -3
View File
@@ -9,7 +9,7 @@ build_assets() {
}
echo "> Build artifact."
build_assets
#build_assets
# Calculate output directory.
echo "> Calculate artifact SHA."
@@ -34,8 +34,8 @@ echo "> Modify asset paths, etc. in index.html."
pushd $output_dir > /dev/null
# /assets/output/main.built.js -> /assets/main.built.js
sed -i "s/assets\/output/assets/g" index.html
# /assets/main.built.js -> /assets/${checksum}/main.built.js
sed -i "s/assets/assets\/${checksum}/g" index.html
# /assets/main.built.js -> //cdn.junglehorse.com/assets/${checksum}/main.built.js
sed -i "s/\/assets/\/\/cdn.junglehorse.com\/assets\/${checksum}/g" index.html
sed -i "s/asset_content_hash/${checksum}/g" index.html
sed -i "s/DEVELOPMENT/production/g" index.html
popd > /dev/null
@@ -43,6 +43,7 @@ popd > /dev/null
echo "> Upload to S3."
aws s3 cp $output_dir s3://junglehorse-frontend/assets/${checksum} --recursive
aws s3 cp $output_dir/index.html s3://junglehorse-frontend/index.html
aws s3 cp $output_dir/error.html s3://junglehorse-frontend/error.html
popd > /dev/null
echo "> Done."
+10
View File
@@ -0,0 +1,10 @@
<!doctype html>
<html lang="en-US">
<head>
<title>Jungle Horse &mdash; Error</title>
</head>
<body>
<h1>Error</h1>
<p>This thing doesn't exist.</p>
</body>
</html>