Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.55 KB | None | 0 0
  1. while read oldrev newrev ref
  2. do
  3.     if [[ $ref =~ .*/master$ ]];
  4.     then
  5.         echo "Deploying to Live Server..."
  6.             git --work-tree=/var/www/vhosts/domain.com/live --git-dir=/var/www/vhosts/domain.com/domain.git checkout master -f
  7.     elif [[ $ref =~ .*/develop$ ]];
  8.     then
  9.         echo "Deploying to Development Server..."
  10.             git --work-tree=/var/www/vhosts/domain.com/dev --git-dir=/var/www/vhosts/domain.com/domain.git checkout develop -f
  11.     else
  12.         echo "Only the master or dev branches may be deployed."
  13.     fi
  14. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement