capistrano-scm-git_with_submodule_and_resolv_symlinks 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/capistrano-scm-git_with_submodule_and_resolv_symlinks.gemspec +1 -1
- data/lib/capistrano/scm/git_with_submodule_and_resolv_symlinks.rb +22 -4
- data/lib/capistrano/scm/git_with_submodule_and_resolv_symlinks/version.rb +1 -1
- data/lib/capistrano/scm/tasks/git_with_submodule_and_resolv_symlinks.rake +2 -2
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7da55a4861e2193727eee4253092326821620a8
|
4
|
+
data.tar.gz: 685b30a1f1efb8685d35e9d069764ca6a354927c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c6fc77bc0e8f3a0478ea083d4e0d29e0fb0d13247833907ab31c16eccaa274405f5a339a419e374031a96b0714b82573542f46c72804333d0e2aa1caf1cb61d
|
7
|
+
data.tar.gz: 815016db88fb94fe72eee9b97948b47f733e50b3d6ac57895e21cf09cd36d0a4de829cffb114a908fbbb912a30e8f42d3afb64b0e329f1e129e5f37abb822d61
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency "capistrano", "
|
22
|
+
spec.add_dependency "capistrano", ">= 3.7.0", "< 3.9.0"
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.12"
|
24
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
25
|
spec.add_development_dependency "rspec", "~> 3.0"
|
@@ -1,5 +1,8 @@
|
|
1
1
|
require 'capistrano/scm/plugin'
|
2
2
|
require 'capistrano/scm/git_with_submodule_and_resolv_symlinks/version'
|
3
|
+
require 'cgi'
|
4
|
+
require 'shellwords'
|
5
|
+
require 'uri'
|
3
6
|
|
4
7
|
module Capistrano
|
5
8
|
class SCM
|
@@ -12,7 +15,7 @@ module Capistrano
|
|
12
15
|
set_if_empty :"#{nsp}_wrapper_path", lambda {
|
13
16
|
# Try to avoid permissions issues when multiple users deploy the same app
|
14
17
|
# by using different file names in the same dir for each deployer and stage.
|
15
|
-
suffix = [:application, :stage, :local_user].map { |key| fetch(key).to_s }.join("-")
|
18
|
+
suffix = [:application, :stage, :local_user].map { |key| fetch(key).to_s }.join("-")
|
16
19
|
"#{fetch(:tmp_dir)}/git-ssh-#{suffix}.sh"
|
17
20
|
}
|
18
21
|
set_if_empty :"#{nsp}_environmental_variables", lambda {
|
@@ -39,15 +42,15 @@ module Capistrano
|
|
39
42
|
end
|
40
43
|
|
41
44
|
def check_repo_is_reachable
|
42
|
-
git :'ls-remote',
|
45
|
+
git :'ls-remote', git_repo_url, "HEAD"
|
43
46
|
end
|
44
47
|
|
45
48
|
def clone_repo
|
46
|
-
git :clone,
|
49
|
+
git :clone, git_repo_url, repo_path.to_s
|
47
50
|
end
|
48
51
|
|
49
52
|
def update_mirror
|
50
|
-
git :remote, "set-url", "origin",
|
53
|
+
git :remote, "set-url", "origin", git_repo_url
|
51
54
|
git :remote, :update, "--prune"
|
52
55
|
git :checkout, "--detach", real_branch
|
53
56
|
git :submodule, :update, "--init"
|
@@ -77,6 +80,21 @@ module Capistrano
|
|
77
80
|
args.unshift :git
|
78
81
|
backend.execute(*args)
|
79
82
|
end
|
83
|
+
|
84
|
+
def git_repo_url
|
85
|
+
if fetch(:git_http_username) && fetch(:git_http_password)
|
86
|
+
URI.parse(repo_url).tap do |repo_uri|
|
87
|
+
repo_uri.user = fetch(:git_http_username)
|
88
|
+
repo_uri.password = CGI.escape(fetch(:git_http_password))
|
89
|
+
end.to_s
|
90
|
+
elsif fetch(:git_http_username)
|
91
|
+
URI.parse(repo_url).tap do |repo_uri|
|
92
|
+
repo_uri.user = fetch(:git_http_username)
|
93
|
+
end.to_s
|
94
|
+
else
|
95
|
+
repo_url
|
96
|
+
end
|
97
|
+
end
|
80
98
|
end
|
81
99
|
end
|
82
100
|
end
|
@@ -5,9 +5,9 @@ namespace scm.nsp do
|
|
5
5
|
desc "Upload the git wrapper script, this script guarantees that we can script git without getting an interactive prompt"
|
6
6
|
task :wrapper do
|
7
7
|
on release_roles :all do
|
8
|
-
execute :mkdir, "-p", File.dirname(fetch(:"#{scm.nsp}_wrapper_path"))
|
8
|
+
execute :mkdir, "-p", File.dirname(fetch(:"#{scm.nsp}_wrapper_path")).shellescape
|
9
9
|
upload! StringIO.new("#!/bin/sh -e\nexec /usr/bin/ssh -o PasswordAuthentication=no -o StrictHostKeyChecking=no \"$@\"\n"), fetch(:"#{scm.nsp}_wrapper_path")
|
10
|
-
execute :chmod, "700", fetch(:"#{scm.nsp}_wrapper_path")
|
10
|
+
execute :chmod, "700", fetch(:"#{scm.nsp}_wrapper_path").shellescape
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-scm-git_with_submodule_and_resolv_symlinks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YAMADA Tsuyoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.7.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.9.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 3.7.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.9.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: bundler
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|