Created
November 14, 2013 01:31
-
-
Save corny/7459729 to your computer and use it in GitHub Desktop.
Capistrano 3 with Git Submodules
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
# Save this file as lib/capistrano/tasks/git.cap | |
namespace :git do | |
desc 'Copy repo to releases' | |
task create_release: :'git:update' do | |
on roles(:all) do | |
with fetch(:git_environmental_variables) do | |
within repo_path do | |
execute :git, :clone, '-b', fetch(:branch), '--recursive', '.', release_path | |
end | |
end | |
end | |
end | |
end |
I got NameError: uninitialized constant Capistrano::Git
in Capistrano 3.6.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you. After deployed I found I 'cd' to the directory of submodule and found that 'git branch' point to no branch. So I have to add another task to force it checkout to master branch. Any ideas?