Last active
October 4, 2015 15:11
-
-
Save knoopx/9a72dbba941c01adc715 to your computer and use it in GitHub Desktop.
git push based deployment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -xeuf -o pipefail | |
export DEPLOY_PATH="/home/deploy/mindo.io" | |
export CURRENT_PATH="$DEPLOY_PATH/current" | |
export REPO_PATH="$DEPLOY_PATH/repo" | |
export SHARED_PATH="$DEPLOY_PATH/shared" | |
export RELEASE_PATH="$DEPLOY_PATH/releases/$(date +%s)" | |
while read FROM_REVISION REVISION REF_NAME | |
do | |
mkdir -p $RELEASE_PATH | |
git archive $REVISION | tar -x -C $RELEASE_PATH | |
cd $RELEASE_PATH && $RELEASE_PATH/post-deploy | |
ln -nfs $RELEASE_PATH $CURRENT_PATH | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment