Created
April 23, 2014 07:55
-
-
Save seenmyfate/11206162 to your computer and use it in GitHub Desktop.
Capistrano v3 custom Submodule Strategy example
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
require 'capistrano/setup' | |
require 'capistrano/deploy' | |
require 'capistrano/scm' | |
require 'capistrano/git' | |
class Capistrano::Git < Capistrano::SCM | |
module SubmoduleStrategy | |
include DefaultStrategy | |
def release | |
context.execute :rm, '-rf', release_path | |
git :clone, '--branch', fetch(:branch), | |
'--recursive', | |
'--no-hardlinks', | |
repo_path, release_path | |
end | |
end | |
end |
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
# ....other configuration | |
set :git_strategy, Capistrano::Git::SubmoduleStrategy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying to find some way to do this, but this doesn't work in Capistrano 3.11 since the
DefaultStrategy
constant is not found.