Skip to content

Instantly share code, notes, and snippets.

@jedfoster
Forked from edrex/publish.sh
Created December 17, 2015 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jedfoster/72940bf4187803724f2f to your computer and use it in GitHub Desktop.
Save jedfoster/72940bf4187803724f2f to your computer and use it in GitHub Desktop.
Upload static site to S3 with clean URLs
#!/bin/sh
# Be sure to set the index and 404 docs to "index" and "404" respectively in your bucket settings
# replace with your compile command
harp compile ./ ./out
# removes the html extension
for f in `ls out/*.html out/**/*.html`; do mv $f "${f%%.*}"; done
# requires s3cmd >= v1.5.0-beta1 for
# https://github.com/s3tools/s3cmd/issues/243
s3cmd sync --default-mime-type="text/html; charset=utf-8" --guess-mime-type --delete-removed out/ s3://eric.pdxhub.org/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment