capistrano-git-with-submodules 1.2.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/capistrano/scm/git-with-submodules.rb +31 -26
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9aad3b41b20c9296e52b0f7846d68aa21a411661
|
4
|
+
data.tar.gz: 85af7e6d2cdf2e139cbbddcf5a8386ca3dc40e44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce98c3410e3972868c18ebc971975238a70968939375f82348e8a38aeb4d496cf16197f80f0f1a47aed305685c4e38c686cf8dd10eda59617f006d068a11f5af
|
7
|
+
data.tar.gz: 8ba481914671ef9113a65b564130edc45b5f7b3baa6b47814daa7e4d8af06abb3e8ce4e220c0c6df3d14da0312c3b1b46abff3b58c2a421bb474938f7b6ae93b
|
data/README.md
CHANGED
@@ -9,21 +9,21 @@ 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', '~>
|
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', '~>
|
17
|
+
gem 'capistrano-git-with-submodules', '~> 2.0', :github => 'ekho/capistrano-git-with-submodules'
|
18
18
|
```
|
19
19
|
|
20
20
|
#### Capfile
|
21
|
-
|
21
|
+
After
|
22
22
|
```ruby
|
23
23
|
require "capistrano/scm/git"
|
24
24
|
install_plugin Capistrano::SCM::Git
|
25
25
|
```
|
26
|
-
|
26
|
+
add
|
27
27
|
```ruby
|
28
28
|
require "capistrano/scm/git-with-submodules"
|
29
29
|
install_plugin Capistrano::SCM::Git::WithSubmodules
|
@@ -1,35 +1,40 @@
|
|
1
|
-
require "capistrano/
|
1
|
+
require "capistrano/plugin"
|
2
2
|
|
3
|
-
class Capistrano::SCM::Git::WithSubmodules < Capistrano::
|
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
|
7
|
-
|
5
|
+
def register_hooks
|
6
|
+
after 'git:create_release', 'git:submodules:create_release'
|
7
|
+
end
|
8
8
|
|
9
|
-
|
9
|
+
def define_tasks
|
10
|
+
namespace :git do
|
11
|
+
namespace :submodules do
|
10
12
|
|
11
|
-
|
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
|
-
|
14
|
-
|
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
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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, 'update', '--init', '--depth', 1, '--checkout', '--recursive', quiet
|
32
|
+
execute :find, release_path, "-name '.git'", "-printf 'removed %p'", "-delete"
|
33
|
+
execute :rm, "-f#{verbose}", temp_index_file_path.to_s
|
34
|
+
end if test :test, '-f', release_path.join('.gitmodules')
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
33
38
|
end
|
34
39
|
end
|
35
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-git-with-submodules
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boris Gorbylev
|
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
version: 1.3.6
|
56
56
|
requirements: []
|
57
57
|
rubyforge_project:
|
58
|
-
rubygems_version: 2.
|
58
|
+
rubygems_version: 2.6.8
|
59
59
|
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: Git submodules support for Capistrano 3.7+
|