dapp 0.7.31 → 0.7.32

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b58a8e42818ef2cdcf82709deda4f51b72484577
4
- data.tar.gz: c3ec885db3436122767c139c25b660e94050d816
3
+ metadata.gz: b8e2d54d5e6eb7e5eede29862e0cc68e6c1e7ffa
4
+ data.tar.gz: 320dea6138d6c2b1efc4b9bae2eded54b471d005
5
5
  SHA512:
6
- metadata.gz: 38f3ea345dd12f38e514ce933d65a0fafaaaa06cc50f44598fcfc2bbd1e299f3bcf47e0e6c8819107167c80eb5b3eee62ea7b891c994c8281e3248ac51568315
7
- data.tar.gz: f9e73babbc79298bdd07cacb1531bda9fc9a7eba79f68f7960d3d45eb520b6f0dfafd530b15f8aa0f5523d69cea6edec20e4a27bff5304746731aece1c5cb00c
6
+ metadata.gz: 72d073adb207a6c08a81e9f5f09f5ebacdaf3d3289ee5a0578cab6615e135c0691a8de5832a46b60740d51289f5b9603095f847bd3bd44c2fa786de3672cfbe1
7
+ data.tar.gz: 1be7e0b1f1223a1625a67f32de3cd30f2c92357897b390f8787dfc3989d2981220a9b2d85ca7ef5b365fed1f66411dc4e69ee4a6d1bf57eaa15a06f0a3a3afef
@@ -11,11 +11,11 @@ module Dapp
11
11
  end
12
12
 
13
13
  def container_path
14
- dimg.container_tmp_path "#{name}.git"
14
+ raise
15
15
  end
16
16
 
17
17
  def path
18
- dimg.tmp_path("#{name}.git").to_s
18
+ raise
19
19
  end
20
20
 
21
21
  def git_bare
@@ -7,7 +7,7 @@ module Dapp
7
7
  end
8
8
 
9
9
  def container_path
10
- dimg.container_dapp_path('own', "#{name}.git")
10
+ dimg.container_dapp_path('git_repo_own', "#{name}.git")
11
11
  end
12
12
 
13
13
  def path
@@ -9,27 +9,46 @@ module Dapp
9
9
 
10
10
  dimg.project.log_secondary_process(dimg.project.t(code: 'process.git_artifact_clone', data: { name: name }), short: true) do
11
11
  begin
12
- Rugged::Repository.clone_at(
13
- url, path,
14
- bare: true,
15
- credentials: proc do |_, username|
16
- @_rugged_credentials = Rugged::Credentials::SshKeyFromAgent.new(username: username)
17
- end
18
- )
12
+ Rugged::Repository.clone_at(url, path, bare: true, credentials: _rugged_credentials)
19
13
  rescue Rugged::NetworkError, Rugged::SslError => e
20
14
  raise Error::Rugged, code: :rugged_remote_error, data: { message: e.message, url: url }
21
15
  end
22
16
  end unless File.directory?(path)
23
17
  end
24
18
 
19
+ def _rugged_credentials
20
+ @_rugged_credentials ||= begin
21
+ ssh_url = begin
22
+ URI.parse(@url)
23
+ false
24
+ rescue URI::InvalidURIError
25
+ true
26
+ end
27
+
28
+ if ssh_url
29
+ host_with_user = @url.split(':', 2).first
30
+ username = host_with_user.split('@', 2).reverse.last
31
+ Rugged::Credentials::SshKeyFromAgent.new(username: username)
32
+ end
33
+ end
34
+ end
35
+
36
+ def path
37
+ dimg.build_path('git_repo_remote', name, Digest::MD5.hexdigest(@url)).to_s
38
+ end
39
+
40
+ def container_path
41
+ dimg.container_tmp_path('git_repo_remote', name, Digest::MD5.hexdigest(@url)).to_s
42
+ end
43
+
25
44
  def git_bare
26
- @git_bare ||= Rugged::Repository.new(path, bare: true, credentials: @_rugged_credentials)
45
+ @git_bare ||= Rugged::Repository.new(path, bare: true, credentials: _rugged_credentials)
27
46
  end
28
47
 
29
48
  def fetch!(branch = nil)
30
49
  branch ||= self.branch
31
50
  dimg.project.log_secondary_process(dimg.project.t(code: 'process.git_artifact_fetch', data: { name: name }), short: true) do
32
- git_bare.fetch('origin', [branch], credentials: @_rugged_credentials)
51
+ git_bare.fetch('origin', [branch], credentials: _rugged_credentials)
33
52
  raise Error::Rugged, code: :branch_not_exist_in_remote_git_repository, data: { branch: branch, url: url } unless branch_exist?(branch)
34
53
  end unless dimg.ignore_git_fetch || dimg.project.dry_run?
35
54
  end
@@ -1,5 +1,5 @@
1
1
  # Version
2
2
  module Dapp
3
- VERSION = '0.7.31'.freeze
3
+ VERSION = '0.7.32'.freeze
4
4
  BUILD_CACHE_VERSION = '6.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.31
4
+ version: 0.7.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Stolyarov