dapp 0.22.6 → 0.22.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/bin/dapp +9 -5
  3. data/config/en/common.yml +2 -0
  4. data/config/en/net_status.yml +9 -12
  5. data/lib/dapp.rb +12 -47
  6. data/lib/dapp/cli/command/options/tag.rb +39 -0
  7. data/lib/dapp/config/directive/base.rb +2 -1
  8. data/lib/dapp/dapp.rb +6 -9
  9. data/lib/dapp/dapp/command/common.rb +9 -4
  10. data/lib/dapp/dapp/logging/i18n.rb +5 -1
  11. data/lib/dapp/dapp/logging/process.rb +2 -2
  12. data/lib/dapp/deployment/config/config.rb +5 -5
  13. data/lib/dapp/deployment/config/directive/expose.rb +1 -1
  14. data/lib/dapp/deployment/config/directive/namespace/instance_methods.rb +1 -1
  15. data/lib/dapp/deployment/error/app.rb +1 -1
  16. data/lib/dapp/deployment/error/{base.rb → default.rb} +1 -1
  17. data/lib/dapp/deployment/error/deployment.rb +1 -1
  18. data/lib/dapp/deployment/error/kubernetes.rb +1 -1
  19. data/lib/dapp/deployment/kubernetes.rb +3 -3
  20. data/lib/dapp/deployment/kubernetes/error.rb +4 -4
  21. data/lib/dapp/deployment/secret.rb +1 -1
  22. data/lib/dapp/dimg/cli/command/dimg.rb +2 -1
  23. data/lib/dapp/dimg/cli/command/dimg/build_context/export.rb +5 -0
  24. data/lib/dapp/dimg/cli/command/dimg/flush_local.rb +24 -0
  25. data/lib/dapp/dimg/cli/command/dimg/push.rb +2 -26
  26. data/lib/dapp/dimg/cli/command/dimg/stages/base.rb +2 -2
  27. data/lib/dapp/dimg/cli/command/dimg/tag.rb +11 -4
  28. data/lib/dapp/dimg/config/config.rb +1 -1
  29. data/lib/dapp/dimg/config/directive/artifact.rb +5 -5
  30. data/lib/dapp/dimg/config/directive/artifact_base.rb +5 -5
  31. data/lib/dapp/dimg/config/directive/dimg/instance_methods.rb +1 -1
  32. data/lib/dapp/dimg/config/directive/dimg/validation.rb +11 -13
  33. data/lib/dapp/dimg/config/directive/docker/artifact.rb +1 -1
  34. data/lib/dapp/dimg/config/directive/docker/base.rb +1 -1
  35. data/lib/dapp/dimg/config/directive/git_artifact_local.rb +19 -3
  36. data/lib/dapp/dimg/config/directive/git_artifact_remote.rb +3 -1
  37. data/lib/dapp/dimg/config/directive/mount.rb +3 -3
  38. data/lib/dapp/dimg/dapp/command/build.rb +1 -1
  39. data/lib/dapp/dimg/dapp/command/build_context/export.rb +17 -13
  40. data/lib/dapp/dimg/dapp/command/build_context/import.rb +24 -17
  41. data/lib/dapp/dimg/dapp/command/cleanup_repo.rb +26 -33
  42. data/lib/dapp/dimg/dapp/command/common.rb +53 -56
  43. data/lib/dapp/dimg/dapp/command/flush_local.rb +18 -0
  44. data/lib/dapp/dimg/dapp/command/mrproper.rb +1 -1
  45. data/lib/dapp/dimg/dapp/command/push.rb +2 -8
  46. data/lib/dapp/dimg/dapp/command/spush.rb +2 -4
  47. data/lib/dapp/dimg/dapp/command/stages/cleanup_local.rb +41 -46
  48. data/lib/dapp/dimg/dapp/command/stages/cleanup_repo.rb +35 -39
  49. data/lib/dapp/dimg/dapp/command/stages/common.rb +13 -3
  50. data/lib/dapp/dimg/dapp/command/stages/flush_local.rb +1 -3
  51. data/lib/dapp/dimg/dapp/command/stages/flush_repo.rb +3 -3
  52. data/lib/dapp/dimg/dapp/command/stages/pull.rb +2 -12
  53. data/lib/dapp/dimg/dapp/command/stages/push.rb +2 -8
  54. data/lib/dapp/dimg/dapp/command/tag.rb +3 -6
  55. data/lib/dapp/dimg/dapp/dapp.rb +1 -0
  56. data/lib/dapp/dimg/dapp/dappfile.rb +11 -1
  57. data/lib/dapp/dimg/dimg.rb +39 -31
  58. data/lib/dapp/dimg/error/build.rb +1 -1
  59. data/lib/dapp/dimg/error/chef.rb +1 -5
  60. data/lib/dapp/dimg/error/{command.rb → default.rb} +1 -1
  61. data/lib/dapp/dimg/error/dimg.rb +1 -1
  62. data/lib/dapp/dimg/error/lock.rb +1 -1
  63. data/lib/dapp/dimg/error/registry.rb +1 -1
  64. data/lib/dapp/dimg/error/rugged.rb +1 -1
  65. data/lib/dapp/dimg/error/tar_writer.rb +1 -1
  66. data/lib/dapp/dimg/git_artifact.rb +3 -1
  67. data/lib/dapp/dimg/image/argument.rb +3 -1
  68. data/lib/dapp/dimg/image/dimg.rb +15 -0
  69. data/lib/dapp/dimg/image/stage.rb +0 -9
  70. data/lib/dapp/error/base.rb +1 -5
  71. data/lib/dapp/error/command.rb +5 -0
  72. data/lib/dapp/error/config.rb +5 -0
  73. data/lib/dapp/error/dapp.rb +1 -1
  74. data/lib/dapp/error/dappfile.rb +1 -1
  75. data/lib/dapp/error/default.rb +11 -0
  76. data/lib/dapp/error/mod/user.rb +11 -0
  77. data/lib/dapp/error/shellout.rb +1 -1
  78. data/lib/dapp/exception/base.rb +1 -1
  79. data/lib/dapp/helper/yaml.rb +3 -2
  80. data/lib/dapp/kube/cli/command/kube/deploy.rb +2 -26
  81. data/lib/dapp/kube/cli/command/kube/lint.rb +1 -26
  82. data/lib/dapp/kube/cli/command/kube/render.rb +2 -26
  83. data/lib/dapp/kube/cli/command/kube/secret_key_generate.rb +2 -2
  84. data/lib/dapp/kube/dapp/command/common.rb +19 -23
  85. data/lib/dapp/kube/dapp/command/deploy.rb +16 -9
  86. data/lib/dapp/kube/dapp/command/dismiss.rb +1 -1
  87. data/lib/dapp/kube/dapp/command/lint.rb +4 -10
  88. data/lib/dapp/kube/dapp/command/minikube_setup.rb +12 -18
  89. data/lib/dapp/kube/dapp/command/secret_edit.rb +2 -2
  90. data/lib/dapp/kube/error/{command.rb → default.rb} +1 -1
  91. data/lib/dapp/kube/error/kubernetes.rb +1 -1
  92. data/lib/dapp/kube/helm/release.rb +7 -33
  93. data/lib/dapp/kube/helm/values.rb +140 -0
  94. data/lib/dapp/kube/kubernetes/client.rb +9 -10
  95. data/lib/dapp/kube/kubernetes/client/error.rb +14 -8
  96. data/lib/dapp/kube/kubernetes/error.rb +15 -0
  97. data/lib/dapp/kube/kubernetes/manager/deployment.rb +2 -2
  98. data/lib/dapp/kube/secret.rb +1 -1
  99. data/lib/dapp/version.rb +1 -1
  100. metadata +15 -11
  101. data/lib/dapp/config/error/config.rb +0 -7
  102. data/lib/dapp/deployment/error/command.rb +0 -7
  103. data/lib/dapp/deployment/error/config.rb +0 -7
  104. data/lib/dapp/dimg/error/base.rb +0 -7
  105. data/lib/dapp/dimg/error/config.rb +0 -7
  106. data/lib/dapp/kube/error/base.rb +0 -11
@@ -1,7 +1,7 @@
1
1
  module Dapp
2
2
  module Dimg
3
3
  module Error
4
- class Build < Base; end
4
+ class Build < Default; end
5
5
  end
6
6
  end
7
7
  end
@@ -1,11 +1,7 @@
1
1
  module Dapp
2
2
  module Dimg
3
3
  module Error
4
- class Chef < Base
5
- def initialize(**net_status)
6
- super(context: 'chef', **net_status)
7
- end
8
- end
4
+ class Chef < Default; end
9
5
  end
10
6
  end
11
7
  end
@@ -1,7 +1,7 @@
1
1
  module Dapp
2
2
  module Dimg
3
3
  module Error
4
- class Command < Base; end
4
+ class Default < ::Dapp::Error::Default; end
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Dapp
2
2
  module Dimg
3
3
  module Error
4
- class Dimg < Base; end
4
+ class Dimg < Default; end
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Dapp
2
2
  module Dimg
3
3
  module Error
4
- class Lock < Base; end
4
+ class Lock < Default; end
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Dapp
2
2
  module Dimg
3
3
  module Error
4
- class Registry < Base; end
4
+ class Registry < Default; end
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Dapp
2
2
  module Dimg
3
3
  module Error
4
- class Rugged < Base; end
4
+ class Rugged < Default; end
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Dapp
2
2
  module Dimg
3
3
  module Error
4
- class TarWriter < Base; end
4
+ class TarWriter < Default; end
5
5
  end
6
6
  end
7
7
  end
@@ -6,12 +6,13 @@ module Dapp
6
6
 
7
7
  attr_reader :repo
8
8
  attr_reader :name
9
+ attr_reader :as
9
10
 
10
11
  # FIXME: переименовать cwd в from
11
12
 
12
13
  # rubocop:disable Metrics/ParameterLists
13
14
  def initialize(repo, to:, name: nil, branch: nil, commit: nil,
14
- cwd: nil, include_paths: nil, exclude_paths: nil, owner: nil, group: nil,
15
+ cwd: nil, include_paths: nil, exclude_paths: nil, owner: nil, group: nil, as: nil,
15
16
  stages_dependencies: {})
16
17
  @repo = repo
17
18
  @name = name
@@ -25,6 +26,7 @@ module Dapp
25
26
  @exclude_paths = exclude_paths
26
27
  @owner = owner
27
28
  @group = group
29
+ @as = as
28
30
 
29
31
  @stages_dependencies = stages_dependencies
30
32
  end
@@ -65,7 +65,9 @@ module Dapp
65
65
  def prepare_instructions(options)
66
66
  options.map do |key, vals|
67
67
  case key
68
- when :cmd, :entrypoint then [vals]
68
+ when :cmd, :entrypoint
69
+ vals = [''] if vals == []
70
+ [vals]
69
71
  when :env, :label then vals.map(&method(:options_to_args)).flatten
70
72
  else vals
71
73
  end.map { |val| %(#{key.to_s.upcase} #{val}) }
@@ -0,0 +1,15 @@
1
+ module Dapp
2
+ module Dimg
3
+ module Image
4
+ class Dimg < Stage
5
+ def export!(export_name = name)
6
+ super(export_name)
7
+ end
8
+
9
+ def tag!(tag_name = name)
10
+ super(tag_name)
11
+ end
12
+ end
13
+ end # Image
14
+ end # Dimg
15
+ end # Dapp
@@ -32,15 +32,6 @@ module Dapp
32
32
  !built_id.nil?
33
33
  end
34
34
 
35
- def export_dimg!(name, sheme_name:)
36
- self.class.new(name: name, dapp: dapp, from: self).tap do |image|
37
- image.add_service_change_label(:'dapp-tag-scheme' => sheme_name)
38
- image.add_service_change_label(:'dapp-dimg' => true)
39
- image.build!
40
- image.export!(name)
41
- end
42
- end
43
-
44
35
  def export!(name)
45
36
  tag!(name).tap do |image|
46
37
  image.push!
@@ -1,9 +1,5 @@
1
1
  module Dapp
2
2
  module Error
3
- class Base < NetStatus::Exception
4
- def initialize(net_status = {})
5
- super({ context: self.class.to_s.split('::').last.downcase }.merge(net_status))
6
- end
7
- end
3
+ class Base < NetStatus::Exception; end
8
4
  end
9
5
  end
@@ -0,0 +1,5 @@
1
+ module Dapp
2
+ module Error
3
+ class Command < Default; end
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Dapp
2
+ module Error
3
+ class Config < Default; end
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module Dapp
2
2
  module Error
3
- class Dapp < Base; end
3
+ class Dapp < Default; end
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Dapp
2
2
  module Error
3
- class Dappfile < Base; end
3
+ class Dappfile < Default; end
4
4
  end
5
5
  end
@@ -0,0 +1,11 @@
1
+ module Dapp
2
+ module Error
3
+ class Default < Base
4
+ include Mod::User
5
+
6
+ def initialize(net_status = {})
7
+ super({ context: self.class.to_s.split('::').last.downcase }.merge(net_status))
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module Dapp
2
+ module Error
3
+ module Mod
4
+ module User
5
+ def user?
6
+ true
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  module Dapp
2
2
  module Error
3
- class Shellout < Base; end
3
+ class Shellout < Default; end
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Dapp
2
2
  module Exception
3
- class Base < Error::Base; end
3
+ class Base < Error::Default; end
4
4
  end
5
5
  end
@@ -1,8 +1,9 @@
1
1
  module Dapp
2
2
  module Helper
3
3
  module YAML
4
- def yaml_load_file(file_path, hash: true)
5
- yaml_load(File.read(file_path), hash: hash)
4
+ def yaml_load_file(file_path, hash: true, default: {})
5
+ return default if (context = File.read(file_path).strip).empty?
6
+ yaml_load(context, hash: hash)
6
7
  rescue ::Dapp::Error::Dapp => e
7
8
  raise ::Dapp::Error::Dapp, code: :yaml_file_incorrect, data: { file: file_path, message: e.net_status[:data][:message] }
8
9
  end
@@ -8,6 +8,8 @@ Usage:
8
8
 
9
9
  Options:
10
10
  BANNER
11
+ extend ::Dapp::CLI::Command::Options::Tag
12
+
11
13
  option :namespace,
12
14
  long: '--namespace NAME',
13
15
  default: nil
@@ -18,32 +20,6 @@ BANNER
18
20
  default: [],
19
21
  proc: proc { |v| composite_options(:image_versions) << v }
20
22
 
21
- option :tag,
22
- long: '--tag TAG',
23
- description: 'Custom tag',
24
- default: [],
25
- proc: proc { |v| composite_options(:tags) << v }
26
-
27
- option :tag_branch,
28
- long: '--tag-branch',
29
- description: 'Tag by git branch',
30
- boolean: true
31
-
32
- option :tag_build_id,
33
- long: '--tag-build-id',
34
- description: 'Tag by CI build id',
35
- boolean: true
36
-
37
- option :tag_ci,
38
- long: '--tag-ci',
39
- description: 'Tag by CI branch and tag',
40
- boolean: true
41
-
42
- option :tag_commit,
43
- long: '--tag-commit',
44
- description: 'Tag by git commit',
45
- boolean: true
46
-
47
23
  option :tmp_dir_prefix,
48
24
  long: '--tmp-dir-prefix PREFIX',
49
25
  description: 'Tmp directory prefix (/tmp by default). Used for build process service directories.'
@@ -8,37 +8,12 @@ Usage:
8
8
 
9
9
  Options:
10
10
  BANNER
11
+ extend ::Dapp::CLI::Command::Options::Tag
11
12
 
12
13
  option :namespace,
13
14
  long: '--namespace NAME',
14
15
  default: nil
15
16
 
16
- option :tag,
17
- long: '--tag TAG',
18
- description: 'Custom tag',
19
- default: [],
20
- proc: proc { |v| composite_options(:tags) << v }
21
-
22
- option :tag_branch,
23
- long: '--tag-branch',
24
- description: 'Tag by git branch',
25
- boolean: true
26
-
27
- option :tag_build_id,
28
- long: '--tag-build-id',
29
- description: 'Tag by CI build id',
30
- boolean: true
31
-
32
- option :tag_ci,
33
- long: '--tag-ci',
34
- description: 'Tag by CI branch and tag',
35
- boolean: true
36
-
37
- option :tag_commit,
38
- long: '--tag-commit',
39
- description: 'Tag by git commit',
40
- boolean: true
41
-
42
17
  option :helm_set_options,
43
18
  long: '--set STRING_ARRAY',
44
19
  default: [],
@@ -8,36 +8,12 @@ Usage:
8
8
 
9
9
  Options:
10
10
  BANNER
11
+ extend ::Dapp::CLI::Command::Options::Tag
12
+
11
13
  option :namespace,
12
14
  long: '--namespace NAME',
13
15
  default: nil
14
16
 
15
- option :tag,
16
- long: '--tag TAG',
17
- description: 'Custom tag',
18
- default: [],
19
- proc: proc { |v| composite_options(:tags) << v }
20
-
21
- option :tag_branch,
22
- long: '--tag-branch',
23
- description: 'Tag by git branch',
24
- boolean: true
25
-
26
- option :tag_build_id,
27
- long: '--tag-build-id',
28
- description: 'Tag by CI build id',
29
- boolean: true
30
-
31
- option :tag_ci,
32
- long: '--tag-ci',
33
- description: 'Tag by CI branch and tag',
34
- boolean: true
35
-
36
- option :tag_commit,
37
- long: '--tag-commit',
38
- description: 'Tag by git commit',
39
- boolean: true
40
-
41
17
  option :tmp_dir_prefix,
42
18
  long: '--tmp-dir-prefix PREFIX',
43
19
  description: 'Tmp directory prefix (/tmp by default). Used for build process service directories.'
@@ -8,8 +8,8 @@ Usage:
8
8
 
9
9
  Options:
10
10
  BANNER
11
- def run_dapp_command(run_method, options: {}, log_running_time: false)
12
- super(run_method, options: options, log_running_time: log_running_time)
11
+ def run_dapp_command(run_method, options: {}, log_running_time: false, **extra_options)
12
+ super(run_method, options: options, log_running_time: log_running_time, **extra_options)
13
13
  end
14
14
  end
15
15
  end
@@ -14,8 +14,7 @@ module Dapp
14
14
 
15
15
  repo = option_repo
16
16
  tag = begin
17
- raise Error::Command, code: :expected_only_one_tag,
18
- data: { tags: option_tags.join(', ') } if option_tags.count > 1
17
+ raise ::Dapp::Error::Command, code: :expected_only_one_tag, data: { tags: option_tags.join(', ') } if option_tags.count > 1
19
18
  option_tags.first
20
19
  end
21
20
  validate_repo_name!(repo)
@@ -44,12 +43,12 @@ module Dapp
44
43
  end
45
44
 
46
45
  def kube_check_helm_chart!
47
- raise Error::Command, code: :helm_directory_not_exist, data: { path: kube_chart_path } unless kube_chart_path.exist?
46
+ raise ::Dapp::Error::Command, code: :helm_directory_not_exist, data: { path: kube_chart_path } unless kube_chart_path.exist?
48
47
  end
49
48
 
50
49
  def kube_check_helm_template_plugin!
51
50
  unless shellout!("helm plugin list | awk '{print $1}'").stdout.lines.map(&:strip).any? { |plugin| plugin == 'template' }
52
- raise Error::Command, code: :helm_template_plugin_not_installed, data: { path: kube_chart_path }
51
+ raise ::Dapp::Error::Command, code: :helm_template_plugin_not_installed, data: { path: kube_chart_path }
53
52
  end
54
53
  end
55
54
 
@@ -103,19 +102,19 @@ module Dapp
103
102
 
104
103
  {{- define "_dimg" -}}
105
104
  {{- $context := index . 0 -}}
106
- {{- if eq (typeOf $context.Values.global.dapp.docker_image) "map[string]interface {}" -}}
105
+ {{- if not $context.Values.global.dapp.is_nameless_dimg -}}
107
106
  {{- required "No dimg specified for template" nil -}}
108
107
  {{- end -}}
109
- {{ $context.Values.global.dapp.docker_image }}
108
+ {{ $context.Values.global.dapp.dimg.docker_image }}
110
109
  {{- end -}}
111
110
 
112
111
  {{- define "_dimg2" -}}
113
112
  {{- $name := index . 0 -}}
114
113
  {{- $context := index . 1 -}}
115
- {{- if ne (typeOf $context.Values.global.dapp.docker_image) "map[string]interface {}" -}}
114
+ {{- if $context.Values.global.dapp.is_nameless_dimg -}}
116
115
  {{- required (printf "No dimg should be specified for template, got `%s`" $name) nil -}}
117
116
  {{- end -}}
118
- {{ required (printf "Unknown dimg `%s` specified for template" $name) (pluck $name $context.Values.global.dapp.docker_image | first) }}
117
+ {{ index (required (printf "Unknown dimg `%s` specified for template" $name) (pluck $name $context.Values.global.dapp.dimg | first)) "docker_image" }}
119
118
  {{- end -}}
120
119
 
121
120
  {{- define "dimg" -}}
@@ -134,7 +133,7 @@ module Dapp
134
133
 
135
134
  {{- define "_dapp_container__imagePullPolicy" -}}
136
135
  {{- $context := index . 0 -}}
137
- {{- if $context.Values.global.dapp.is_branch -}}
136
+ {{- if $context.Values.global.dapp.ci.is_branch -}}
138
137
  imagePullPolicy: Always
139
138
  {{- end -}}
140
139
  {{- end -}}
@@ -169,19 +168,19 @@ image: {{ tuple $name $context | include "_dimg2" }}
169
168
 
170
169
  {{- define "_dimg_id" -}}
171
170
  {{- $context := index . 0 -}}
172
- {{- if eq (typeOf $context.Values.global.dapp.docker_image_id) "map[string]interface {}" -}}
171
+ {{- if not $context.Values.global.dapp.is_nameless_dimg -}}
173
172
  {{- required "No dimg specified for template" nil -}}
174
173
  {{- end -}}
175
- {{ $context.Values.global.dapp.docker_image_id }}
174
+ {{ $context.Values.global.dapp.dimg.docker_image_id }}
176
175
  {{- end -}}
177
176
 
178
177
  {{- define "_dimg_id2" -}}
179
178
  {{- $name := index . 0 -}}
180
179
  {{- $context := index . 1 -}}
181
- {{- if ne (typeOf $context.Values.global.dapp.docker_image_id) "map[string]interface {}" -}}
180
+ {{- if $context.Values.global.dapp.is_nameless_dimg -}}
182
181
  {{- required (printf "No dimg should be specified for template, got `%s`" $name) nil -}}
183
182
  {{- end -}}
184
- {{ required (printf "Unknown dimg `%s` specified for template" $name) (pluck $name $context.Values.global.dapp.docker_image_id | first) }}
183
+ {{ index (required (printf "Unknown dimg `%s` specified for template" $name) (pluck $name $context.Values.global.dapp.dimg | first)) "docker_image_id" }}
185
184
  {{- end -}}
186
185
 
187
186
  {{- define "dimg_id" -}}
@@ -200,7 +199,7 @@ image: {{ tuple $name $context | include "_dimg2" }}
200
199
 
201
200
  {{- define "_dapp_container_env" -}}
202
201
  {{- $context := index . 0 -}}
203
- {{- if $context.Values.global.dapp.is_branch -}}
202
+ {{- if $context.Values.global.dapp.ci.is_branch -}}
204
203
  - name: DOCKER_IMAGE_ID
205
204
  value: {{ tuple $context | include "_dimg_id" }}
206
205
  {{- end -}}
@@ -209,7 +208,7 @@ image: {{ tuple $name $context | include "_dimg2" }}
209
208
  {{- define "_dapp_container_env2" -}}
210
209
  {{- $name := index . 0 -}}
211
210
  {{- $context := index . 1 -}}
212
- {{- if $context.Values.global.dapp.is_branch -}}
211
+ {{- if $context.Values.global.dapp.ci.is_branch -}}
213
212
  - name: DOCKER_IMAGE_ID
214
213
  value: {{ tuple $name $context | include "_dimg_id2" }}
215
214
  {{- end -}}
@@ -238,7 +237,7 @@ image: {{ tuple $name $context | include "_dimg2" }}
238
237
 
239
238
  def kube_values_paths
240
239
  self.options[:helm_values_options].map { |p| Pathname(p).expand_path }.each do |f|
241
- raise Error::Command, code: :values_file_not_found, data: { path: f } unless f.file?
240
+ raise ::Dapp::Error::Command, code: :values_file_not_found, data: { path: f } unless f.file?
242
241
  end
243
242
  end
244
243
 
@@ -260,7 +259,7 @@ image: {{ tuple $name $context | include "_dimg2" }}
260
259
  end
261
260
 
262
261
  def kube_check_helm!
263
- raise Error::Command, code: :helm_not_found if shellout('which helm').exitstatus == 1
262
+ raise ::Dapp::Error::Command, code: :helm_not_found if shellout('which helm').exitstatus == 1
264
263
  end
265
264
 
266
265
  def kube_release_name
@@ -284,15 +283,12 @@ image: {{ tuple $name $context | include "_dimg2" }}
284
283
  end
285
284
 
286
285
  def kube_secret_file_validate!(file_path)
287
- raise Error::Command, code: :secret_file_not_found, data: { path: File.expand_path(file_path) } unless File.exist?(file_path)
288
- raise Error::Command, code: :secret_file_empty, data: { path: File.expand_path(file_path) } if File.read(file_path).strip.empty?
286
+ raise ::Dapp::Error::Command, code: :secret_file_not_found, data: { path: File.expand_path(file_path) } unless File.exist?(file_path)
287
+ raise ::Dapp::Error::Command, code: :secret_file_empty, data: { path: File.expand_path(file_path) } if File.read(file_path).strip.empty?
289
288
  end
290
289
 
291
290
  def secret_key_should_exist!
292
- raise(Error::Command,
293
- code: :secret_key_not_found,
294
- data: {not_found_in: secret_key_not_found_in.join(', ')}
295
- ) if secret.nil?
291
+ raise ::Dapp::Error::Command, code: :secret_key_not_found, data: { not_found_in: secret_key_not_found_in.join(', ') } if secret.nil?
296
292
  end
297
293
 
298
294
  def kube_chart_secret_path(*path)