dapp 0.31.0 → 0.31.1
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/common.yml +1 -0
- data/config/en/net_status.yml +3 -1
- data/lib/dapp/dimg/git_artifact.rb +18 -13
- data/lib/dapp/dimg/git_repo/base.rb +24 -2
- data/lib/dapp/dimg/git_repo/local.rb +9 -8
- data/lib/dapp/dimg/git_repo/own.rb +4 -0
- data/lib/dapp/dimg/git_repo/remote.rb +2 -16
- data/lib/dapp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acbc086c66b025c8c5740bfff5d0bdee5e741f66eca42099f0beeacb5a5af2ff
|
4
|
+
data.tar.gz: 3540b080c1791f3be5ecc317ed2350fe70f3fda3c3e3ac089d74a636ecad46ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c32d9de226d357c3bfddb6891b3ebb7832738c7886fc0a7e61fd31b702d46435d119d3390996b3c734f7fb04b805b91bd8689b5686ceb8a4f7f0f591d6a3d7a9
|
7
|
+
data.tar.gz: 792857d5e53d9818b688b9599f3793f619261529cb86e7a82e8a6aa9aca5f0e348d06c684a44a8229618645cd662085238625baf7badb2e39b79afdd0ee24c35
|
data/config/en/common.yml
CHANGED
@@ -64,6 +64,7 @@ en:
|
|
64
64
|
dapp_secret_key_not_found: "WARNING: Secrets haven't decoded: secret key not found in %{not_found_in}!"
|
65
65
|
introspect_image_impossible: "WARNING: You can't introspect stage `%{name}`!"
|
66
66
|
stage_dependencies_not_found: "WARNING: Stage dependencies `%{dependencies}` haven't been found in repo `%{repo}`!"
|
67
|
+
stage_dependencies_file_not_found: "WARNING: Stage dependencies `%{dependencies}` haven't been found in repo `%{repo}`!\nIf you want to consider specific file you should use one of the following git-artifact configuration:\n\n```\ngit:\n- add: /folder/file\n to: /folder/file\n stageDependencies:\n install: ''\n```\n\n```\ngit:\n- add: /folder\n to: /folder\n includePaths: file\n stageDependencies:\n install: file\n```"
|
67
68
|
unsupported_dapp_config_options: "WARNING: .dapp_config includes unsupported options [%{options}]: use only following options [%{supported_options}]"
|
68
69
|
group:
|
69
70
|
install: 'Install group'
|
data/config/en/net_status.yml
CHANGED
@@ -124,8 +124,10 @@ en:
|
|
124
124
|
git_repository_reference_error: "Git repo `%{name}`: %{message}!"
|
125
125
|
rugged_remote_error: "Remote git repo `%{url}`: `%{message}`!"
|
126
126
|
local_git_repository_does_not_exist: "Local git repo (`%{path}`): doesn't exist!"
|
127
|
-
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`!"
|
127
|
+
commit_not_found_in_local_git_repository: "Local git repo (`%{path}`): commit `%{commit}` not found!\nIf commit has been rebased: run command `dapp dimg stages cleanup local --improper-git-commit`!"
|
128
128
|
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`!"
|
129
|
+
git_local_submodule_commit_not_found: "Git repo `%{path}`: submodule commit `%{commit}` not found!"
|
130
|
+
git_remote_submodule_commit_not_found: "Git repo `%{url}`: submodule commit `%{commit}` not found!"
|
129
131
|
branch_not_exist_in_remote_git_repository: "Remote git repo `%{url}`: branch `%{branch}` not exist!"
|
130
132
|
rugged_protocol_not_supported: "Rugged has been compiled without support for `%{protocol}`.\nGit repositories will not be reachable via `%{protocol}` (`%{url}`).\nRugged.features should include `%{protocol}`."
|
131
133
|
git_local_incorrect_gitmodules_params: "Local git repo with invalid `.gitmodules` file: %{error}"
|
@@ -158,19 +158,21 @@ module Dapp
|
|
158
158
|
elsif cwd == ''
|
159
159
|
:directory
|
160
160
|
else
|
161
|
-
|
161
|
+
cwd_type_by_commit(repo.lookup_commit(stage.layer_commit(self)))
|
162
|
+
end
|
163
|
+
end
|
162
164
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
165
|
+
def cwd_type_by_commit(commit)
|
166
|
+
cwd_entry = begin
|
167
|
+
commit.tree.path(cwd)
|
168
|
+
rescue Rugged::TreeError
|
169
|
+
end
|
167
170
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
end
|
171
|
+
if cwd_entry
|
172
|
+
if cwd_entry[:type] == :tree
|
173
|
+
:directory
|
174
|
+
else
|
175
|
+
:file
|
174
176
|
end
|
175
177
|
end
|
176
178
|
end
|
@@ -248,13 +250,16 @@ module Dapp
|
|
248
250
|
|
249
251
|
stage_dependencies_key = [stage.name, commit]
|
250
252
|
|
253
|
+
@stage_dependencies_warning ||= {}
|
251
254
|
@stage_dependencies_checksums ||= {}
|
252
255
|
@stage_dependencies_checksums[stage_dependencies_key] ||= begin
|
253
256
|
if dev_mode?
|
254
257
|
dev_patch_hash(paths: paths)
|
255
258
|
else
|
256
|
-
if (entries = repo_entries(commit, paths: paths)).empty?
|
257
|
-
|
259
|
+
if (entries = repo_entries(commit, paths: paths)).empty? && @stage_dependencies_warning[stage.name].nil?
|
260
|
+
@stage_dependencies_warning[stage.name] = true
|
261
|
+
code = cwd_type_by_commit(repo.lookup_commit(commit)) == :file ? :stage_dependencies_file_not_found : :stage_dependencies_not_found
|
262
|
+
repo.dapp.log_warning(desc: { code: code,
|
258
263
|
data: { repo: repo.respond_to?(:url) ? repo.url : 'local',
|
259
264
|
dependencies: stage_dependencies.join(', ') } })
|
260
265
|
end
|
@@ -67,8 +67,30 @@ module Dapp
|
|
67
67
|
.select { |s| !ignore_directory?(s.path, paths: paths, exclude_paths: exclude_paths) }
|
68
68
|
end
|
69
69
|
|
70
|
-
def submodules_git(
|
71
|
-
|
70
|
+
def submodules_git(commit)
|
71
|
+
submodules_git_path(commit).tap do |git_path|
|
72
|
+
break begin
|
73
|
+
if git_path.directory?
|
74
|
+
Rugged::Repository.new(git_path.to_s)
|
75
|
+
else
|
76
|
+
Rugged::Repository.clone_at(path.to_s, git_path.to_s).tap do |submodules_git|
|
77
|
+
begin
|
78
|
+
submodules_git.checkout(commit)
|
79
|
+
rescue Rugged::ReferenceError
|
80
|
+
raise_submodule_commit_not_found!(commit)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def submodules_git_path(commit)
|
89
|
+
Pathname(File.join(dapp.host_docker_tmp_config_dir, "submodule", dapp.consistent_uniq_slugify(name), commit).to_s)
|
90
|
+
end
|
91
|
+
|
92
|
+
def raise_submodule_commit_not_found!(_)
|
93
|
+
raise
|
72
94
|
end
|
73
95
|
|
74
96
|
def submodule_url(gitsubmodule_url)
|
@@ -30,18 +30,19 @@ module Dapp
|
|
30
30
|
submodules(commit, paths: paths, exclude_paths: exclude_paths).map do |submodule|
|
31
31
|
next if commit.nil? && !submodule.in_config?
|
32
32
|
submodule_params(submodule).tap do |params|
|
33
|
-
if commit.nil?
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
dapp.log_info("Using local submodule `#{params[:path]}`!")
|
38
|
-
params[:type] = :local
|
39
|
-
end
|
33
|
+
params[:commit] = submodule.workdir_oid || params[:commit] if commit.nil?
|
34
|
+
if submodule.in_workdir? && !submodule.uninitialized?
|
35
|
+
dapp.log_info("Using local submodule repository `#{params[:path]}`!")
|
36
|
+
params[:type] = :local
|
40
37
|
end
|
41
38
|
end
|
42
39
|
end.compact
|
43
40
|
end
|
44
41
|
|
42
|
+
def raise_submodule_commit_not_found!(commit)
|
43
|
+
raise Error::Rugged, code: :git_local_submodule_commit_not_found, data: { commit: commit, path: path }
|
44
|
+
end
|
45
|
+
|
45
46
|
def ignore_patch?(patch, paths: [], exclude_paths: [])
|
46
47
|
delta_new_file = patch.delta.new_file
|
47
48
|
args = [delta_new_file[:path], paths: paths, exclude_paths: exclude_paths]
|
@@ -79,7 +80,7 @@ module Dapp
|
|
79
80
|
def lookup_commit(commit)
|
80
81
|
super
|
81
82
|
rescue Rugged::OdbError, TypeError => _e
|
82
|
-
raise Error::Rugged, code: :commit_not_found_in_local_git_repository, data: { commit: commit }
|
83
|
+
raise Error::Rugged, code: :commit_not_found_in_local_git_repository, data: { commit: commit, path: path }
|
83
84
|
end
|
84
85
|
|
85
86
|
protected
|
@@ -100,22 +100,8 @@ module Dapp
|
|
100
100
|
raise Error::Rugged, code: :commit_not_found_in_remote_git_repository, data: { commit: commit, url: url }
|
101
101
|
end
|
102
102
|
|
103
|
-
def
|
104
|
-
|
105
|
-
break begin
|
106
|
-
if git_path.directory?
|
107
|
-
Rugged::Repository.new(git_path.to_s)
|
108
|
-
else
|
109
|
-
Rugged::Repository.clone_at(path.to_s, git_path.to_s).tap do |submodules_git|
|
110
|
-
submodules_git.checkout(commit)
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
def submodules_git_path(commit)
|
118
|
-
Pathname(File.join(dapp.host_docker_tmp_config_dir, "submodule", dapp.consistent_uniq_slugify(name), commit).to_s)
|
103
|
+
def raise_submodule_commit_not_found!(commit)
|
104
|
+
raise Error::Rugged, code: :git_remote_submodule_commit_not_found, data: { commit: commit, url: url }
|
119
105
|
end
|
120
106
|
|
121
107
|
protected
|
data/lib/dapp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.31.
|
4
|
+
version: 0.31.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Stolyarov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|