From 3a992e3a107a14cc5f8a2903d0f4d02de2071d7c Mon Sep 17 00:00:00 2001 From: Evan Kaufman Date: Thu, 28 Jul 2016 16:40:34 -0700 Subject: [PATCH] Adding git submodule support for cap deployments --- lib/yeoman/templates/Capfile | 3 +++ lib/yeoman/templates/Gemfile | 1 + lib/yeoman/templates/Gemfile.lock | 3 +++ lib/yeoman/templates/lib/capistrano/deploy.rb | 1 + 4 files changed, 8 insertions(+) diff --git a/lib/yeoman/templates/Capfile b/lib/yeoman/templates/Capfile index 4cb85371..2003003f 100644 --- a/lib/yeoman/templates/Capfile +++ b/lib/yeoman/templates/Capfile @@ -7,6 +7,9 @@ require 'capistrano/setup' # Includes default deployment tasks require 'capistrano/deploy' +# Load git submodules as necessary +require 'capistrano/git-submodule-strategy' + # Includes tasks from other gems included in your Gemfile # # For documentation on these, see for example: diff --git a/lib/yeoman/templates/Gemfile b/lib/yeoman/templates/Gemfile index bba62b80..3c0c1957 100644 --- a/lib/yeoman/templates/Gemfile +++ b/lib/yeoman/templates/Gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' gem 'capistrano', '~> 3.2.1', require: false, group: :development +gem 'capistrano-git-submodule-strategy', '~> 0.1', require: false, group: :development gem 'colored', '~> 1.2', require: false, group: :development gem 'launchy', '~> 2.4', require: false, group: :development diff --git a/lib/yeoman/templates/Gemfile.lock b/lib/yeoman/templates/Gemfile.lock index 91465e81..633e9fd8 100644 --- a/lib/yeoman/templates/Gemfile.lock +++ b/lib/yeoman/templates/Gemfile.lock @@ -6,6 +6,8 @@ GEM i18n rake (>= 10.0.0) sshkit (~> 1.3) + capistrano-git-submodule-strategy (0.1.22) + capistrano (~> 3.1) colored (1.2) colorize (0.7.3) i18n (0.6.9) @@ -25,5 +27,6 @@ PLATFORMS DEPENDENCIES capistrano (~> 3.2.1) + capistrano-git-submodule-strategy (~> 0.1) colored (~> 1.2) launchy (~> 2.4) diff --git a/lib/yeoman/templates/lib/capistrano/deploy.rb b/lib/yeoman/templates/lib/capistrano/deploy.rb index f46208ba..bd71a225 100644 --- a/lib/yeoman/templates/lib/capistrano/deploy.rb +++ b/lib/yeoman/templates/lib/capistrano/deploy.rb @@ -16,6 +16,7 @@ set :linked_dirs, %w{web/wp-content/uploads} set :wp_path, "#{release_path}/web/wp" set :www, <%= props.www ? 'true' : 'false' %> +set :git_strategy, Capistrano::Git::SubmoduleStrategy namespace :deploy do after :updated, :bower_install do