minfra-cli 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5429a3e13b8387b6c3e011eaa2513ac5963ef30c4a14f9458e882a7df0507753
4
- data.tar.gz: 2dbdd6e4e0f4c3cbade95033f52af2480a7a0b421508a68066e1a87ab6049109
3
+ metadata.gz: 20d6ef8704c3f8f61e70deebd60afc9663a9df46e2741f03a30eb9f5020fe2e0
4
+ data.tar.gz: b173a73d17868a0b8f13ce11cdefc0e997aa50af7bb07c0448946fa121d9275d
5
5
  SHA512:
6
- metadata.gz: 188ce70ec6fabf9b6d72ddfc0855ce499e63c92bc079d525e044dec3c21b49d5a6c2aba1576a869c5126ef3a27f14bc7aa1e7222b1deff49e8cc35c645cda621
7
- data.tar.gz: 877789c92138b28e33314592464fc5650765729a90ea8d84388c9ca10ea4065dd5988fbfbc9b047ebf0604d28552e38243d5407a52ee7cf9ae18f03b075b8e19
6
+ metadata.gz: 5725dd5eed53295676e895f14bf84a3d729fa82664b5578dde1540f47455b1050e236d9321291185ed935e14a1a9de3b691e82b8ce83db9c0f7b19419877cab4
7
+ data.tar.gz: 6b92c6757e2d0ccfaefe8d6847c55c77800159e820ff7f41f54c4d3bff9801118b566febed21be9f92bcfd4cd9a443dcb29f09487e8a7366d0273a92858be337
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 2.2.0
2
+ * fixing: should not modify l('env.roles')
3
+ * cleanup: removing template testing --debug flag, causing noise
4
+ * cleanup: removing Documentation hooks
5
+ * fixing: hiera lookup retrying on gpg memory error exceptions
6
+ *
1
7
  # 2.1.0
2
8
  * add :all hook
3
9
  * fixing setup dev
@@ -101,7 +101,7 @@ module Minfra
101
101
  run(%(docker network rm #{kind_name}), exit_on_error: false)
102
102
  end
103
103
 
104
- def deploy(stack_name, reason_message)
104
+ def deploy(stack_name, _reason_message)
105
105
  # TBD: options is global, avoid it!
106
106
 
107
107
  test = options[:test]
@@ -145,8 +145,6 @@ module Minfra
145
145
 
146
146
  exit_error('Deployment aborted!') if !(@config.dev? || options[:force] == true) && !Ask.boolean('Are the changes ok?')
147
147
 
148
- message = "deploying stack #{stack.name}: #{reason_message}."
149
- Minfra::Cli::Document.document(@config, "started #{message}")
150
148
  orch = Orchparty::App.new(cluster_name: cluster,
151
149
  application_name: stack.name,
152
150
  force_variable_definition: false,
@@ -154,7 +152,6 @@ module Minfra
154
152
  status_dir: stack.release_path,
155
153
  options:)
156
154
  orch.send(method)
157
- Minfra::Cli::Document.document(@config, "finished #{message}")
158
155
  end
159
156
 
160
157
  def rollback(stack_name, env, deployment, cluster)
@@ -47,9 +47,7 @@ module Minfra
47
47
  ARGV.delete('test')
48
48
 
49
49
  if File.exist?('./bin/run_tests')
50
- # config = Config.load('staging')
51
50
  project = ProjectInfo.load(Pathname.pwd)
52
- # Minfra::Cli::Document.document(config, "Using project specific ./bin/run_tests in #{project.name}")
53
51
  debug "Using project specific ./bin/run_tests in #{project.name}"
54
52
  system('./bin/run_tests', out: $stdout, err: :out)
55
53
  else
@@ -35,7 +35,7 @@ module Minfra
35
35
  def deploy(stack_name, message = '')
36
36
  stacks = l('env.roles') || l('env.stacks') || []
37
37
  default_stacks = minfra_config.project.default_stacks || []
38
- stacks = stacks.concat(default_stacks)
38
+ stacks = stacks + default_stacks
39
39
  if stacks.include?(stack_name) || options[:force] || options[:test]
40
40
  kube.deploy(stack_name, message)
41
41
  else
@@ -39,6 +39,7 @@ module Minfra
39
39
  else
40
40
  :deep
41
41
  end
42
+ retry_attempts = 0
42
43
  begin
43
44
  result = @hiera.lookup(fst_value, default, @scope, nil, lookup_type)
44
45
  rescue GPGME::Error::NoSecretKey
@@ -50,6 +51,10 @@ module Minfra
50
51
  rescue GPGME::Error
51
52
  error("Having decrypt problems for hiera key: #{value}, #{$ERROR_INFO.message}")
52
53
  raise Errors::ExitError
54
+ rescue Errno::ENOMEM # see https://github.com/ueno/ruby-gpgme/issues/147
55
+ retry_attempts += 1
56
+ sleep 1
57
+ retry if retry_attempts < 5
53
58
  end
54
59
  result = result.dig(*values) if !values.empty? && result.is_a?(Hash) # we return nil or the scalar value and only drill down on hashes
55
60
  result = default if result.nil?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Minfra
4
4
  module Cli
5
- VERSION = '2.1.0'
5
+ VERSION = '2.2.0'
6
6
  end
7
7
  end
data/lib/minfra/cli.rb CHANGED
@@ -18,7 +18,6 @@ require_relative 'cli/hook'
18
18
  require_relative 'cli/common'
19
19
  require_relative 'cli/command'
20
20
  require_relative 'cli/ask'
21
- require_relative 'cli/document'
22
21
  require_relative 'cli/runner'
23
22
  require_relative 'cli/helm_runner'
24
23
  require_relative 'cli/kubectl_runner'
@@ -188,7 +188,7 @@ module Orchparty
188
188
 
189
189
  def print_install
190
190
  build_chart do |chart_path|
191
- cmd = "helm template --namespace #{namespace} --debug --kube-context #{cluster_name} --output-dir #{chart_path.join(
191
+ cmd = "helm template --namespace #{namespace} --kube-context #{cluster_name} --output-dir #{chart_path.join(
192
192
  '..', 'helm_expanded'
193
193
  )} #{service.name} #{chart_path}"
194
194
  @out_io.puts `$cmd`
data/minfra-cli.gemspec CHANGED
@@ -36,5 +36,6 @@ Gem::Specification.new do |spec|
36
36
  spec.add_runtime_dependency "hiera", "3.9.0"
37
37
  spec.add_runtime_dependency "hiera-eyaml", "3.3.0"
38
38
  spec.add_runtime_dependency "hiera-eyaml-gpg", "0.7.4"
39
+ spec.add_runtime_dependency "gpgme", "~>2.0.0"
39
40
  end
40
41
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minfra-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Schrammel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-30 00:00:00.000000000 Z
11
+ date: 2024-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -142,6 +142,20 @@ dependencies:
142
142
  - - '='
143
143
  - !ruby/object:Gem::Version
144
144
  version: 0.7.4
145
+ - !ruby/object:Gem::Dependency
146
+ name: gpgme
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: 2.0.0
152
+ type: :runtime
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: 2.0.0
145
159
  description: A cli framework for k8s based development and deployment.
146
160
  email:
147
161
  - peter.schrammel@gmx.de
@@ -187,7 +201,6 @@ files:
187
201
  - lib/minfra/cli/common.rb
188
202
  - lib/minfra/cli/config.rb
189
203
  - lib/minfra/cli/core_ext.rb
190
- - lib/minfra/cli/document.rb
191
204
  - lib/minfra/cli/env.rb
192
205
  - lib/minfra/cli/errors.rb
193
206
  - lib/minfra/cli/helm_runner.rb
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Minfra
4
- module Cli
5
- class Document
6
- def self.document(config, message)
7
- new(config).document(message)
8
- end
9
-
10
- def initialize(config)
11
- @config = config
12
- end
13
-
14
- def document(_message)
15
- return true if @config.dev?
16
-
17
- puts 'TBD: calling documentation hooks'
18
- true
19
- end
20
- end
21
- end
22
- end