Update website metadata fixes

This commit is contained in:
Seth Vargo 2016-04-12 20:14:56 +01:00
parent 07e9c09a58
commit fd5b9347f2
2 changed files with 25 additions and 6 deletions

View File

@ -27,14 +27,16 @@
"FASTLY_API_KEY={{ user `fastly_api_key` }}"
],
"inline": [
"apt-get update",
"apt-get install -y build-essential curl git libffi-dev s3cmd wget",
"apt-get -qq update",
"apt-get -yqq install build-essential curl git libffi-dev wget",
"apt-get -yqq install python-pip",
"pip install s3cmd",
"cd /app",
"bundle check || bundle install --jobs 7",
"bundle exec middleman build",
"/usr/bin/env bash ./scripts/deploy.sh"
"/bin/bash ./scripts/deploy.sh"
]
}
]

View File

@ -63,13 +63,30 @@ if [ -z "$NO_UPLOAD" ]; then
sync "$DIR/build/" "s3://hc-sites/$PROJECT/latest/"
# The s3cmd guessed mime type for text files is often wrong. This is
# problematic for JS/CSS, so force their mime types to be correct.
# problematic for some assets, so force their mime types to be correct.
echo "Overriding javascript mime-types..."
s3cmd \
--mime-type="application/javascript" \
modify "s3://hc-sites/$PROJECT/latest/assets/javascripts/*.js"
--exclude "*" \
--include "*.js" \
--recursive \
modify "s3://hc-sites/$PROJECT/latest/"
echo "Overriding css mime-types..."
s3cmd \
--mime-type="text/css" \
modify "s3://hc-sites/$PROJECT/latest/assets/stylesheets/*.css"
--exclude "*" \
--include "*.css" \
--recursive \
modify "s3://hc-sites/$PROJECT/latest/"
echo "Overriding svg mime-types..."
s3cmd \
--mime-type="image/svg+xml" \
--exclude "*" \
--include "*.svg" \
--recursive \
modify "s3://hc-sites/$PROJECT/latest/"
fi
# Perform a soft-purge of the surrogate key.