Created
August 9, 2018 15:33
-
-
Save svetlio/2f3901fb18ad6032670b3b09a6a9e5e7 to your computer and use it in GitHub Desktop.
git push to prepopulate code in webdir
This file contains hidden or 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 | |
while read oldrev newrev ref | |
do | |
branch=`echo $ref | cut -d/ -f3` | |
if [[ "master" == "$branch" ]]; then | |
git --work-tree=/var/www/vhosts/bms2/ checkout -f $branch | |
echo 'Changes pushed master to bms2' | |
ln -sf /var/sites/bms2/settings.php /var/www/bms2/sites/default/settings.php | |
ln -sf /var/sites/bms2/.htaccess /var/www/bms2/.htaccess | |
ln -sf /var/sites/bms2/files /var/www/bms2/sites/default/files | |
ln -sf /var/sites/bms2/files-private /var/www/bms2/sites/default/files-private | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment