Skip to content

Commit

Permalink
Checkout the branch + clear composer cache + rm temporary files
Browse files Browse the repository at this point in the history
  • Loading branch information
ngilain committed Feb 24, 2016
1 parent ee75b43 commit 0dc62de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions deployment/tasks/composer_update.cap
Expand Up @@ -6,14 +6,17 @@ namespace :composer do
execute "cd ~;rm -rf ./#{fetch(:update_dir)};mkdir #{fetch(:update_dir)};"

puts "\n\e[36m\e[1m> Cloning Open Orchestra"
execute "cd ~/#{fetch(:update_dir)};git clone #{fetch(:repo_url)};"
execute "cd ~/#{fetch(:update_dir)};git clone #{fetch(:repo_url)};cd #{fetch(:git_project_dir)};git checkout #{fetch(:branch)}"

puts "\n\e[36m\e[1m> Updating dependencies"
execute "cd ~/#{fetch(:update_dir)}/#{fetch(:git_project_dir)};composer update --no-progress;"
execute "cd ~/#{fetch(:update_dir)}/#{fetch(:git_project_dir)};composer clear-cache;composer update --no-progress --ignore-platform-reqs;"

puts "\n\e[36m\e[1m> Pushing the composer.lock to a new Git branch"
execute "cd ~/#{fetch(:update_dir)}/#{fetch(:git_project_dir)};git add composer.lock;git commit -m \"auto update vendor\";git pull --rebase origin #{fetch(:branch)};git push origin #{fetch(:branch)}:auto_update_vendor"

puts "\n\e[36m\e[1m> Removing temporary files"
execute "cd ~;rm -rf #{fetch(:update_dir)}"

puts "\n\e[32mYou can now connect to Github and create a Pull Request to merge the \"auto_update_vendor\" branch into \"#{fetch(:branch)}\"\e[0m"
end
end
Expand Down

0 comments on commit 0dc62de

Please sign in to comment.