diff --git a/_build/aws/publish-asset.sh b/_build/aws/publish-asset.sh index 0c1d1cb..d3c9de6 100755 --- a/_build/aws/publish-asset.sh +++ b/_build/aws/publish-asset.sh @@ -1,14 +1,16 @@ #!/bin/bash -# args: s3cmd-config +# args: s3cmd-config asset-path set -e +cd "./asset/$2" + s3cmd sync \ --config "$1" \ --acl-public \ --no-preserve \ --add-header 'cache-control:max-age=86400' \ --verbose \ - "./asset/$2" \ - "s3://dpb587-assets-us-west-2/asset/$2" + . \ + "s3://assets.dpb587.me/asset/$2/" diff --git a/_build/aws/publish.sh b/_build/aws/publish.sh index 7a69938..dfd4625 100755 --- a/_build/aws/publish.sh +++ b/_build/aws/publish.sh @@ -4,6 +4,22 @@ set -e +cd "$ARTIFACT_PATH" + +cd static/ + +s3cmd sync \ + --config "$1" \ + --acl-public \ + --no-delete-removed \ + --no-preserve \ + --add-header 'cache-control:max-age=604800' \ + --verbose \ + . \ + s3://dpb587-us-west-2/static/ + +cd ../ + s3cmd sync \ --config "$1" \ --acl-public \ @@ -11,7 +27,8 @@ s3cmd sync \ --no-preserve \ --exclude 'private/*' \ --exclude 'asset/*' \ + --exclude 'static/*' \ --add-header 'cache-control:max-age=3600' \ --verbose \ - "$ARTIFACT_PATH" \ + . \ s3://dpb587-us-west-2 diff --git a/_build/build.sh b/_build/build.sh index 30d028d..3e3cdd7 100755 --- a/_build/build.sh +++ b/_build/build.sh @@ -23,6 +23,8 @@ echo "--> building $ARTIFACT_BRANCH/$ARTIFACT_COMMIT..." jekyll build --config _config.yml,_build/target/_config.yml +mv _build/target/artifact/static/dev _build/target/artifact/static/`echo $ARTIFACT_COMMIT | cut -c-10` + export ARTIFACT_PATH="$PWD/_build/target/artifact" if [[ "" != "$1" ]] ; then diff --git a/_doc/notes.md b/_doc/notes.md index e445dbc..ab8d31a 100644 --- a/_doc/notes.md +++ b/_doc/notes.md @@ -6,4 +6,4 @@ Publish the site: Create a photo gallery: osascript enumerate.scpt 'London-Iceland Trip' | php -dmemory_limit=1G convert.php ~/code/dpb587.me/ 2014-london-iceland-trip - ./_build/aws/publish-asset.sh gallery/2014-london-iceland-trip + ./_build/aws/publish-asset.sh "$AWS_S3CMD_CONFIG" gallery/2014-london-iceland-trip diff --git a/_includes/header.html b/_includes/header.html index 8631ea4..f3dce7a 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -6,9 +6,9 @@