update build/publish scripts; gallery changes

This commit is contained in:
Danny Berger
2014-03-27 16:11:42 -06:00
parent 9877fc69a7
commit 8c20c0b4f8
13 changed files with 145 additions and 77 deletions

14
_build/aws/publish-asset.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
# args: s3cmd-config
set -e
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"

17
_build/aws/publish.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# args: s3cmd-config
set -e
s3cmd sync \
--config "$1" \
--acl-public \
--no-delete-removed \
--no-preserve \
--exclude 'private/*' \
--exclude 'asset/*' \
--add-header 'cache-control:max-age=3600' \
--verbose \
"$ARTIFACT_PATH" \
s3://dpb587-us-west-2

33
_build/build.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/bash
# args: follow-script follow-args...
set -e
[ -e _build/target ] && rm -fr _build/target
mkdir _build/target
export ARTIFACT_COMMIT=`git rev-parse HEAD`
export ARTIFACT_BRANCH=`git rev-parse --abbrev-ref HEAD`
echo "--> building $ARTIFACT_BRANCH/$ARTIFACT_COMMIT..."
(
echo 'artifact_commit:' "$ARTIFACT_COMMIT" ;
echo 'artifact_branch:' "$ARTIFACT_BRANCH" ;
echo 'destination: _build/target/artifact' ;
echo 'asset_prefix: //assets.dpb587.me/asset' ;
echo 'environment: prod'
) > _build/target/_config.yml
jekyll build --config _config.yml,_build/target/_config.yml
export ARTIFACT_PATH="$PWD/_build/target/artifact"
if [[ "" != "$1" ]] ; then
exec $@
else
env | grep '^ARTIFACT_' | sed 's/^/export /'
fi