Skip to content

Instantly share code, notes, and snippets.

@webkonstantin
Created July 17, 2015 15:18
Show Gist options
  • Save webkonstantin/80c3323247c30ab4093f to your computer and use it in GitHub Desktop.
Save webkonstantin/80c3323247c30ab4093f to your computer and use it in GitHub Desktop.
@servers([ 'web' => '[email protected]', 'localhost' => 'localhost' ])
@macro('deploy')
deploy:merge
deploy:assets
deploy:push
deploy:pull
@endmacro
@task('deploy:merge', ['on' => 'localhost'])
cd /Users/sw_double/sites/octopod/tutjdut/web
pwd
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
echo Merging \'$CURRENT_BRANCH\' to \'deploy\' branch
git checkout deploy
git merge --no-edit $CURRENT_BRANCH
git checkout $CURRENT_BRANCH
@endtask
@task('deploy:assets', ['on' => 'localhost'])
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
echo Merging \'$CURRENT_BRANCH\' to \'deploy\' branch
git checkout deploy
./build.sh
git add -u .
git commit -m 'Add built assets'
git checkout $CURRENT_BRANCH
@endtask
@task('deploy:push', ['on' => 'localhost'])
git push -f -u deploy deploy
@endtask
@task('deploy:pull', ['on' => 'web'])
cd /root/auth-legacy.tutjdut.ru
pwd
git fetch
git checkout -f deploy
git reset --hard origin/deploy
docker exec tutjdut.web bash -c "cd /var/www && ./composer update"
@endtask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment