From 96ce7d938bb7ab2fc1520f703ceddc8e3355ce3f Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 17 Jan 2019 08:56:48 +0100 Subject: Dockerized deployment method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- script/post-receive | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'script/post-receive') diff --git a/script/post-receive b/script/post-receive index 3f4f8ee..debe3dd 100644 --- a/script/post-receive +++ b/script/post-receive @@ -22,7 +22,7 @@ NAME=jo GIT_REPO=$HOME/$NAME.git TARGET_BRANCH=master -# Exported so it's picked by the `script/build.sh` script. +# Exported so it's picked by the `script/docker-build.sh` script. export BUILD_SOURCE=$HOME/tmp/$NAME export BUILD_DEST=/srv/$NAME/www @@ -30,14 +30,14 @@ while read oldrev newrev refname do branch=$(git rev-parse --symbolic --abbrev-ref $refname) if [ -n "$branch" ] && [ "$TARGET_BRANCH" == "$branch" ]; then + set -x + # Re-generate git repository in a temporary directory. - rm -Rf $TMP_GIT_CLONE + rm -Rf $BUILD_SOURCE git clone $GIT_REPO $BUILD_SOURCE # Build site - chmod +x $BUILD_SOURCE/script/build.sh - BUNDLE_GEMFILE=$BUILD_SOURCE/Gemfile bundle install - BUNDLE_GEMFILE=$BUILD_SOURCE/Gemfile $BUILD_SOURCE/script/build.sh - rm -Rf $BUILD_SOURCE + chmod +x $BUILD_SOURCE/script/docker-build.sh + POST_RECEIVE=true NUKE=true $BUILD_SOURCE/script/docker-build.sh fi done -- cgit v1.2.3