Last active
February 6, 2017 17:23
-
-
Save jaonoctus/2b6f2fb783cbbca93f83f5043df2f7d0 to your computer and use it in GitHub Desktop.
git push deploy
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
#!/bin/bash | |
# Variables | |
USER_PATH='/home/user' | |
REPO_PATH=$USER_PATH'/repo' | |
PRODUCTION_PATH=$USER_PATH'/production' | |
while read oldrev newrev ref | |
do | |
branch=`echo $ref | cut -d/ -f3` | |
export GIT_DIR=$REPO_PATH | |
if [ "master" == "$branch" ]; then | |
echo "Deploying PRODUCTION" | |
export GIT_WORK_TREE=$PRODUCTION_PATH | |
git checkout -f $branch | |
cd $PRODUCTION_PATH | |
composer install | |
php artisan migrate --force | |
#gulp | |
php artisan cache:clear | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PRODUCTION
LOCAL