dapp 0.9.2 → 0.9.3
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/config/en/net_status.yml +4 -2
- data/lib/dapp/dimg/build/stage/ga_latest_patch.rb +19 -1
- data/lib/dapp/dimg/config/directive/git_artifact_remote.rb +6 -1
- data/lib/dapp/dimg/git_repo/own.rb +1 -1
- data/lib/dapp/dimg/git_repo/remote.rb +14 -3
- data/lib/dapp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9a2256c433ec1a0ba5025f5bb51d6c1d32f9dbc
|
4
|
+
data.tar.gz: 54183e3a8a445fa1500e632f54dc8d7073c733bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c2769fec1709ae73c2c483b70e38e1ac7816f809fab9455a1f19208bdb0a63d6541c98962906b0a22f8ca1880d4d65ad7657f9872d16bb7978927ec3c969662
|
7
|
+
data.tar.gz: 46464a15195b713fa5ddf7ae85d6c98db53390f6e7c3608bdab6da7f72a29515da2ffc806cd9f909cb390c23cee45b39f6bd9ea81bdf7c882c1812a9a41e682e
|
data/config/en/net_status.yml
CHANGED
@@ -50,6 +50,7 @@ en:
|
|
50
50
|
stage_artifact_double_associate: "Cannot use `%{stage}` stage for artifact, already used in `%{conflict_stage}` stage!"
|
51
51
|
stage_artifact_not_supported_associated_stage: "Bad artifact stage `%{stage}`!"
|
52
52
|
git_artifact_remote_unsupported_protocol: "Remote git repo `%{url}`: unsupported protocol!"
|
53
|
+
git_artifact_remote_branch_with_commit: "Remote git repo: use `commit` or `branch` directive!"
|
53
54
|
artifact_conflict: "Conflict between artifacts paths!"
|
54
55
|
scratch_unsupported_directive: "Scratch dimg has unsupported directive `%{directive}`!"
|
55
56
|
scratch_artifact_required: "Scratch dimg without artifacts!"
|
@@ -67,7 +68,8 @@ en:
|
|
67
68
|
rugged:
|
68
69
|
rugged_remote_error: "Remote git repo `%{url}`: `%{message}`!"
|
69
70
|
local_git_repository_does_not_exist: "Local git repo: doesn't exist!"
|
70
|
-
commit_not_found_in_local_git_repository: "Local git repo: commit `%{commit}` not found
|
71
|
-
commit_not_found_in_remote_git_repository: "Remote git repo `%{url}`: commit `%{commit}` not found
|
71
|
+
commit_not_found_in_local_git_repository: "Local git repo: commit `%{commit}` not found!\nIf commit has been rebased: run command `dapp dimg stages cleanup local --improper-git-commit`!"
|
72
|
+
commit_not_found_in_remote_git_repository: "Remote git repo `%{url}`: commit `%{commit}` not found!\nIf commit has been rebased: run command `dapp dimg stages cleanup local --improper-git-commit`!"
|
73
|
+
branch_not_exist_in_remote_git_repository: "Remote git repo `%{url}`: branch `%{branch}` not exist!"
|
72
74
|
lock:
|
73
75
|
timeout: "Could not obtain lock for `%{name}` within %{timeout} seconds"
|
@@ -39,11 +39,29 @@ module Dapp
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def empty?
|
42
|
-
dependencies_empty? ||
|
42
|
+
dependencies_empty? || git_artifacts_without_changes?
|
43
43
|
end
|
44
44
|
|
45
45
|
private
|
46
46
|
|
47
|
+
def git_artifacts_without_changes?
|
48
|
+
local_git_artifacts_without_changes? && remote_git_artifacts_without_changes?
|
49
|
+
end
|
50
|
+
|
51
|
+
def local_git_artifacts_without_changes?
|
52
|
+
dimg.local_git_artifacts.all? do |git_artifact|
|
53
|
+
from_commit = prev_g_a_stage.layer_commit(git_artifact)
|
54
|
+
to_commit = dimg.dev_mode? ? nil : layer_commit(git_artifact)
|
55
|
+
!git_artifact.any_changes?(from_commit, to_commit)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def remote_git_artifacts_without_changes?
|
60
|
+
dimg.remote_git_artifacts.all? do |git_artifact|
|
61
|
+
!git_artifact.any_changes?(prev_g_a_stage.layer_commit(git_artifact), layer_commit(git_artifact))
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
47
65
|
def commit_list
|
48
66
|
dimg.git_artifacts.map { |git_artifact| layer_commit(git_artifact) }
|
49
67
|
end
|
@@ -28,7 +28,7 @@ module Dapp
|
|
28
28
|
attr_accessor :_url, :_name, :_branch, :_commit
|
29
29
|
|
30
30
|
def _artifact_options
|
31
|
-
super.merge(name: _name, branch: _branch)
|
31
|
+
super.merge(name: _name, branch: _branch, commit: _commit)
|
32
32
|
end
|
33
33
|
|
34
34
|
protected
|
@@ -40,6 +40,11 @@ module Dapp
|
|
40
40
|
def commit(value)
|
41
41
|
@_commit = value
|
42
42
|
end
|
43
|
+
|
44
|
+
def validate!
|
45
|
+
super
|
46
|
+
raise Error::Config, code: :git_artifact_remote_branch_with_commit if !_branch.nil? && !_commit.nil?
|
47
|
+
end
|
43
48
|
end
|
44
49
|
|
45
50
|
protected
|
@@ -24,16 +24,21 @@ module Dapp
|
|
24
24
|
branch ||= self.branch
|
25
25
|
dimg.dapp.log_secondary_process(dimg.dapp.t(code: 'process.git_artifact_fetch', data: { name: name }), short: true) do
|
26
26
|
git.fetch('origin', [branch])
|
27
|
+
raise Error::Rugged, code: :branch_not_exist_in_remote_git_repository, data: { branch: branch, url: url } unless branch_exist?(branch)
|
27
28
|
end unless dimg.ignore_git_fetch || dimg.dapp.dry_run?
|
28
29
|
end
|
29
30
|
|
30
|
-
def
|
31
|
-
git.
|
31
|
+
def branch_exist?(name)
|
32
|
+
git.branches.exist?(branch_format(name))
|
33
|
+
end
|
34
|
+
|
35
|
+
def latest_commit(name)
|
36
|
+
git.ref("refs/remotes/#{branch_format(name)}").target_id
|
32
37
|
end
|
33
38
|
|
34
39
|
def lookup_commit(commit)
|
35
40
|
super
|
36
|
-
rescue Rugged::OdbError => _e
|
41
|
+
rescue Rugged::OdbError, TypeError => _e
|
37
42
|
raise Error::Rugged, code: :commit_not_found_in_remote_git_repository, data: { commit: commit, url: url }
|
38
43
|
end
|
39
44
|
|
@@ -44,6 +49,12 @@ module Dapp
|
|
44
49
|
def git
|
45
50
|
super(bare: true)
|
46
51
|
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
def branch_format(name)
|
56
|
+
"origin/#{name.reverse.chomp('origin/'.reverse).reverse}"
|
57
|
+
end
|
47
58
|
end
|
48
59
|
end
|
49
60
|
end
|
data/lib/dapp/version.rb
CHANGED