fix build to use clean checkout
This commit is contained in:
@@ -25,9 +25,8 @@ s3cmd sync \
|
|||||||
--acl-public \
|
--acl-public \
|
||||||
--no-delete-removed \
|
--no-delete-removed \
|
||||||
--no-preserve \
|
--no-preserve \
|
||||||
--exclude 'private/*' \
|
--rexclude 'asset/.+' \
|
||||||
--exclude 'asset/*' \
|
--rexclude 'static/.+' \
|
||||||
--exclude 'static/*' \
|
|
||||||
--add-header 'cache-control:max-age=3600' \
|
--add-header 'cache-control:max-age=3600' \
|
||||||
--verbose \
|
--verbose \
|
||||||
. \
|
. \
|
||||||
|
|||||||
@@ -4,9 +4,13 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
RPWD=$PWD
|
||||||
|
|
||||||
[ -e _build/target ] && rm -fr _build/target
|
[ -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_COMMIT=`git rev-parse HEAD`
|
||||||
export ARTIFACT_BRANCH=`git rev-parse --abbrev-ref 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_commit:' "$ARTIFACT_COMMIT" ;
|
||||||
echo 'artifact_branch:' "$ARTIFACT_BRANCH" ;
|
echo 'artifact_branch:' "$ARTIFACT_BRANCH" ;
|
||||||
echo 'destination: _build/target/artifact' ;
|
|
||||||
echo 'asset_prefix: //assets.dpb587.me/asset' ;
|
echo 'asset_prefix: //assets.dpb587.me/asset' ;
|
||||||
echo 'environment: prod'
|
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
|
if [[ "" != "$1" ]] ; then
|
||||||
exec $@
|
exec $@
|
||||||
else
|
else
|
||||||
env | grep '^ARTIFACT_' | sed 's/^/export /'
|
env | grep '^ARTIFACT_' | sed 's/^/export /'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
Reference in New Issue
Block a user