Skip to content

Commit

Permalink
website: force JS/CSS mime-types on deploy
Browse files Browse the repository at this point in the history
Should fix occassional issues with application/octet-stream mime type
assets breaking JS/CSS on site.
  • Loading branch information
phinze committed Apr 7, 2016
1 parent 7eb9175 commit 54132c1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions website/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ if [ -z "$NO_UPLOAD" ]; then
--add-header="Cache-Control: max-age=31536000" \
--add-header="x-amz-meta-surrogate-key: site-$PROJECT" \
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.
s3cmd \
--mime-type="application/javascript" \
modify "s3://hc-sites/$PROJECT/latest/assets/javascripts/*.js"
s3cmd \
--mime-type="text/css" \
modify "s3://hc-sites/$PROJECT/latest/assets/stylesheets/*.css"
fi

# Perform a soft-purge of the surrogate key.
Expand Down

0 comments on commit 54132c1

Please sign in to comment.