capistrano-git-with-submodules 1.2.1 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 369fba65acde05c8def4e1f53bf518cae8c6c943
4
- data.tar.gz: 7a36a19ab3d2a320b0d9883452a31b9dbbbebaa0
2
+ SHA256:
3
+ metadata.gz: 43acbb9322fd5d355f4c4319dde1006472da125350c443097e35884c7745aab1
4
+ data.tar.gz: 877486aea429e70c9a1ebb2e97507dd124e88148ee4ef800c68726a6f22f48c4
5
5
  SHA512:
6
- metadata.gz: 2da4ed36202e8f24202999ff4e544b8db8074af1725631c442ceabf244b8433c6ec67d7aaf65f209f9cde9993f8e7b7beffb9fc4eefba6c67a3dac7b50a1188a
7
- data.tar.gz: 8d7e5f4d77b03eae94c11f7d7eeab54dc1bf36040ed2b9061797594885908e1d9efe0668cf39c8503711ceacee82510a9b46733c28ad782fdba7835d607078b8
6
+ metadata.gz: 877d813c32ba9b95f081793e9f710a870a5559dd15a0689f4c8de83ece3fd930f1c29d115141023a7ca759532e81ef7cc1b3e3c209e29d9a36600be9db5903c0
7
+ data.tar.gz: 4a2dfd75e751471b8606b49b6b949b7c11fa68fb64f1edef00f6cbc7853e422345d5b3470f5e2896ef79ef327e685a274b06d8c5cb6a9c51187aac803074753f
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # capistrano-git-with-submodules [![Gem](https://img.shields.io/gem/v/capistrano-git-with-submodules.svg?maxAge=86400)](https://rubygems.org/gems/capistrano-git-with-submodules) [![Gem](https://img.shields.io/gem/dt/capistrano-git-with-submodules.svg?maxAge=86400)](https://rubygems.org/gems/capistrano-git-with-submodules)
1
+ # capistrano-git-with-submodules [![Gem](https://img.shields.io/gem/v/capistrano-git-with-submodules.svg?maxAge=21600)](https://rubygems.org/gems/capistrano-git-with-submodules) [![Gem](https://img.shields.io/gem/dt/capistrano-git-with-submodules.svg?maxAge=21600)](https://rubygems.org/gems/capistrano-git-with-submodules)
2
2
 
3
3
  Git submodule support for Capistrano 3.7+
4
4
 
@@ -9,26 +9,28 @@ For Capistrano 3.0-3.6 use old [capistrano-git-submodule-strategy](https://githu
9
9
  #### Gemfile
10
10
  From rubygems.org (recommended)
11
11
  ```ruby
12
- gem 'capistrano-git-with-submodules', '~> 1.2'
12
+ gem 'capistrano-git-with-submodules', '~> 2.0'
13
13
  ```
14
14
 
15
15
  Latest revision from github
16
16
  ```ruby
17
- gem 'capistrano-git-with-submodules', '~> 1.2', :github => 'ekho/capistrano-git-with-submodules'
17
+ gem 'capistrano-git-with-submodules', '~> 2.0', :github => 'ekho/capistrano-git-with-submodules'
18
18
  ```
19
19
 
20
20
  #### Capfile
21
- Change default
21
+ After
22
22
  ```ruby
23
23
  require "capistrano/scm/git"
24
24
  install_plugin Capistrano::SCM::Git
25
25
  ```
26
- to
26
+ add
27
27
  ```ruby
28
28
  require "capistrano/scm/git-with-submodules"
29
29
  install_plugin Capistrano::SCM::Git::WithSubmodules
30
30
  ```
31
31
 
32
+ > If you are upgrading from [`capistrano-git-submodule-strategy`](https://github.com/ekho/capistrano-git-submodule-strategy#using) you should remove its settings from your `Gemfile`, `Capfile` and `deploy.rb`.
33
+
32
34
  ## Contributing to capistrano-git-with-submodules
33
35
 
34
36
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
@@ -0,0 +1,9 @@
1
+ module Capistrano
2
+ module Git
3
+ module With
4
+ module Submodules
5
+ VERSION = "2.0.4"
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,35 +1,41 @@
1
- require "capistrano/scm/git"
1
+ require "capistrano/plugin"
2
2
 
3
- class Capistrano::SCM::Git::WithSubmodules < Capistrano::SCM::Git
4
- alias_method :origin_archive_to_release_path, :archive_to_release_path if method_defined?(:archive_to_release_path)
3
+ class Capistrano::SCM::Git::WithSubmodules < Capistrano::Plugin
5
4
 
6
- def archive_to_release_path
7
- origin_archive_to_release_path
5
+ def register_hooks
6
+ after 'git:create_release', 'git:submodules:create_release'
7
+ end
8
8
 
9
- return unless backend.test(:test, '-f', release_path.join('.gitmodules'))
9
+ def define_tasks
10
+ namespace :git do
11
+ namespace :submodules do
10
12
 
11
- submodules_to_release_path
13
+ desc "Adds configured submodules recursively to release"
14
+ # It does so by connecting the bare repo and the work tree using environment variables
15
+ # The reset creates a temporary index, but does not change the working directory
16
+ # The temporary index is removed after everything is done
17
+ task create_release: :'git:update' do
18
+ temp_index_file_path = release_path.join("TEMP_INDEX_#{fetch(:release_timestamp)}")
12
19
 
13
- backend.execute("find #{release_path} -name '.git' -printf 'Deleted %p' -delete")
14
- end
20
+ on release_roles :all do
21
+ with fetch(:git_environmental_variables).merge(
22
+ 'GIT_DIR' => repo_path.to_s,
23
+ 'GIT_WORK_TREE' => release_path.to_s,
24
+ 'GIT_INDEX_FILE' => temp_index_file_path.to_s
25
+ ) do
26
+ within release_path do
27
+ verbose = Rake.application.options.trace ? 'v' : ''
28
+ quiet = Rake.application.options.trace ? '' : '--quiet'
15
29
 
16
- ##
17
- # Adds configured submodules recursively to release
18
- # It does so by connecting the bare repo and the work tree using environment variables
19
- # The reset creates a temporary index, but does not change the working directory
20
- # The temporary index is removed after everything is done
21
- def submodules_to_release_path
22
- temp_index_file_path = release_path.join("INDEX_#{fetch(:release_timestamp)}")
23
- backend.within "../releases/#{fetch(:release_timestamp)}" do
24
- backend.with(
25
- 'GIT_DIR' => repo_path.to_s,
26
- 'GIT_WORK_TREE' => release_path.to_s,
27
- 'GIT_INDEX_FILE' => temp_index_file_path.to_s
28
- ) do
29
- git :reset, '--mixed', fetch(:branch)
30
- git :submodule, 'update', '--init', '--depth', 1, '--checkout', '--recursive'
31
- verbose = Rake.application.options.trace ? 'v' : ''
32
- backend.execute :rm, "-f#{verbose}", temp_index_file_path.to_s
30
+ execute :git, :reset, '--mixed', quiet, fetch(:branch), '--'
31
+ execute :git, :submodule, 'sync', '--recursive', quiet
32
+ execute :git, :submodule, 'update', '--init', '--checkout', '--recursive', quiet
33
+ execute :find, release_path, "-name '.git'", "|", "xargs -I {} rm -rf#{verbose} '{}'"
34
+ execute :rm, "-f#{verbose}", temp_index_file_path.to_s
35
+ end if test :test, '-f', release_path.join('.gitmodules')
36
+ end
37
+ end
38
+ end
33
39
  end
34
40
  end
35
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-git-with-submodules
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Gorbylev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-23 00:00:00.000000000 Z
11
+ date: 2020-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -25,7 +25,8 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.7'
27
27
  description: Git submodules support for Capistrano 3.7+
28
- email: ekho@ekho.name
28
+ email:
29
+ - ekho@ekho.name
29
30
  executables: []
30
31
  extensions: []
31
32
  extra_rdoc_files:
@@ -34,6 +35,7 @@ extra_rdoc_files:
34
35
  files:
35
36
  - LICENSE
36
37
  - README.md
38
+ - lib/capistrano-git-with-submodules/version.rb
37
39
  - lib/capistrano/scm/git-with-submodules.rb
38
40
  homepage: https://github.com/ekho/capistrano-git-with-submodules
39
41
  licenses:
@@ -54,8 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
56
  - !ruby/object:Gem::Version
55
57
  version: 1.3.6
56
58
  requirements: []
57
- rubyforge_project:
58
- rubygems_version: 2.5.2
59
+ rubygems_version: 3.0.3
59
60
  signing_key:
60
61
  specification_version: 4
61
62
  summary: Git submodules support for Capistrano 3.7+