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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/minfra/cli/commands/kube.rb +1 -4
- data/lib/minfra/cli/commands/project.rb +0 -2
- data/lib/minfra/cli/commands/stack.rb +1 -1
- data/lib/minfra/cli/hiera_looker.rb +5 -0
- data/lib/minfra/cli/version.rb +1 -1
- data/lib/minfra/cli.rb +0 -1
- data/lib/orchparty/kubernetes_application.rb +1 -1
- data/minfra-cli.gemspec +1 -0
- metadata +16 -3
- data/lib/minfra/cli/document.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20d6ef8704c3f8f61e70deebd60afc9663a9df46e2741f03a30eb9f5020fe2e0
|
4
|
+
data.tar.gz: b173a73d17868a0b8f13ce11cdefc0e997aa50af7bb07c0448946fa121d9275d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
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
|
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?
|
data/lib/minfra/cli/version.rb
CHANGED
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} --
|
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
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.
|
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-
|
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
|
data/lib/minfra/cli/document.rb
DELETED
@@ -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
|