Created
November 4, 2015 19:48
-
-
Save aharpervc/42f24a4ac19625d26762 to your computer and use it in GitHub Desktop.
Capistrano task to handle git repository url changes
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
task :cope_with_git_repo_relocation do | |
on roles(:app) do | |
capture "if [ -d #{repo_path} ]; then cd #{repo_path} && git remote set-url origin #{fetch(:repo_url)}; else true; fi" | |
end | |
end | |
before :updating, 'deploy:cope_with_git_repo_relocation' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment