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 +5 -5
- data/README.md +7 -5
- data/lib/capistrano-git-with-submodules/version.rb +9 -0
- data/lib/capistrano/scm/git-with-submodules.rb +32 -26
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 43acbb9322fd5d355f4c4319dde1006472da125350c443097e35884c7745aab1
|
4
|
+
data.tar.gz: 877486aea429e70c9a1ebb2e97507dd124e88148ee4ef800c68726a6f22f48c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 877d813c32ba9b95f081793e9f710a870a5559dd15a0689f4c8de83ece3fd930f1c29d115141023a7ca759532e81ef7cc1b3e3c209e29d9a36600be9db5903c0
|
7
|
+
data.tar.gz: 4a2dfd75e751471b8606b49b6b949b7c11fa68fb64f1edef00f6cbc7853e422345d5b3470f5e2896ef79ef327e685a274b06d8c5cb6a9c51187aac803074753f
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# capistrano-git-with-submodules [](https://rubygems.org/gems/capistrano-git-with-submodules) [](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', '~>
|
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
|
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.
|
@@ -1,35 +1,41 @@
|
|
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
|
-
|
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:
|
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:
|
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:
|
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
|
-
|
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+
|