fix build to use clean checkout
This commit is contained in:
@@ -25,9 +25,8 @@ s3cmd sync \
|
||||
--acl-public \
|
||||
--no-delete-removed \
|
||||
--no-preserve \
|
||||
--exclude 'private/*' \
|
||||
--exclude 'asset/*' \
|
||||
--exclude 'static/*' \
|
||||
--rexclude 'asset/.+' \
|
||||
--rexclude 'static/.+' \
|
||||
--add-header 'cache-control:max-age=3600' \
|
||||
--verbose \
|
||||
. \
|
||||
|
||||
@@ -4,9 +4,13 @@
|
||||
|
||||
set -e
|
||||
|
||||
RPWD=$PWD
|
||||
|
||||
[ -e _build/target ] && rm -fr _build/target
|
||||
|
||||
mkdir _build/target
|
||||
git clone file://$PWD _build/target
|
||||
|
||||
cd _build/target
|
||||
|
||||
export ARTIFACT_COMMIT=`git rev-parse HEAD`
|
||||
export ARTIFACT_BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||
@@ -16,20 +20,18 @@ 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
|
||||
) > _config.patch.yml
|
||||
|
||||
jekyll build --config _config.yml,_build/target/_config.yml
|
||||
jekyll build --config _config.yml,_config.patch.yml
|
||||
|
||||
mv _build/target/artifact/static/dev _build/target/artifact/static/`echo $ARTIFACT_COMMIT | cut -c-10`
|
||||
mv _site/static/dev _site/static/`echo $ARTIFACT_COMMIT | cut -c-10`
|
||||
|
||||
export ARTIFACT_PATH="$PWD/_build/target/artifact"
|
||||
export ARTIFACT_PATH="$RPWD/_build/target/_site"
|
||||
|
||||
if [[ "" != "$1" ]] ; then
|
||||
exec $@
|
||||
else
|
||||
env | grep '^ARTIFACT_' | sed 's/^/export /'
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user