diff options
| author | Miquel Sabaté Solà <msabate@suse.com> | 2019-01-17 08:56:48 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <msabate@suse.com> | 2019-01-17 12:16:53 +0100 |
| commit | 96ce7d938bb7ab2fc1520f703ceddc8e3355ce3f (patch) | |
| tree | f735939e017501e8a4f86f39a597e83ad00ad5db /script/post-receive | |
| parent | 13d319d72cc44db35490fd34a71fa69269397668 (diff) | |
| download | jo.mssola.com-96ce7d938bb7ab2fc1520f703ceddc8e3355ce3f.tar.gz jo.mssola.com-96ce7d938bb7ab2fc1520f703ceddc8e3355ce3f.zip | |
Dockerized deployment method
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'script/post-receive')
| -rw-r--r-- | script/post-receive | 12 |
1 files changed, 6 insertions, 6 deletions
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 |
