Skip to content

Instantly share code, notes, and snippets.

@seenmyfate
Created April 23, 2014 07:55
Show Gist options
  • Save seenmyfate/11206162 to your computer and use it in GitHub Desktop.
Save seenmyfate/11206162 to your computer and use it in GitHub Desktop.
Capistrano v3 custom Submodule Strategy example
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
# ....other configuration
set :git_strategy, Capistrano::Git::SubmoduleStrategy
@wmakley
Copy link

wmakley commented Dec 17, 2018

Trying to find some way to do this, but this doesn't work in Capistrano 3.11 since the DefaultStrategy constant is not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment