opswalrus 1.0.43 → 1.0.44

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: c95b5c18a56463ccb9dd8db68875978eb57e3e5311a73825e27b1c893486d1ec
4
- data.tar.gz: '05889e0f2398083e580406575914265488eb97ce98db67aeac92536dc6bc1294'
3
+ metadata.gz: 136dbe2cf55aeca23724fc70f4a71f9faaa3cfbda95c5803b3b37e1345a49366
4
+ data.tar.gz: e6ea3db8d5e5dcfae279396acd31891907821d92c39e161eed857d23d57b8457
5
5
  SHA512:
6
- metadata.gz: 8147ed4fa64cdd0c8125ef6c885fac72075fe4e211e8b31275b7961689d370f44ea10cde45f83df352e35dab4d06c1a4cadd063286bb34d9d29312f8a943213c
7
- data.tar.gz: fdb7a00079382392fc1631f85a64f8939936e9731586fed8c9a63c42557f59540665889376f4e2deec382c08c39d32bab52ce9e62dabbfd50eba87bd1d1397be
6
+ metadata.gz: 8fd11f706aa726c93db026d57783d76aa67d9be92021efc2413185d5b35dfc629e21387408d3946119e77a531841510e8991db6c3b5062ccf4cbfcd3e0961367
7
+ data.tar.gz: 4b73c62902bbd2583b98beaabac6b36342134b3fe1eab982f978c4f1112e6cd978c45c374929caef5396d77794702ce4015237c3aafc3223b120df8ac10da568
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- opswalrus (1.0.43)
4
+ opswalrus (1.0.44)
5
5
  bcrypt_pbkdf (~> 1.1)
6
6
  binding_of_caller (~> 1.0)
7
7
  citrus (~> 3.0)
data/build.ops CHANGED
@@ -53,6 +53,6 @@ if bw_status_json['status'] != 'unlocked'
53
53
  end
54
54
 
55
55
  totp = sh("Get Rubygems OTP") { 'bw get totp Rubygems' }
56
- sh("Push gem", input: {"You have enabled multi-factor authentication. Please enter OTP code." => "#{totp}\n"}) { 'gem push opswalrus-{{ version }}.gem' }
56
+ sh("Push gem", input: {/You have enabled multi-factor authentication. Please enter OTP code./ => "#{totp}\n"}) { 'gem push opswalrus-{{ version }}.gem' }
57
57
  sh("Build docker image") { 'docker build -t ghcr.io/opswalrus/ops:latest -t ghcr.io/opswalrus/ops:{{ version }} -t opswalrus/ops:latest -t opswalrus/ops:{{ version }} .' }
58
58
  sh("Push docker image to ghcr.io/opswalrus/ops") { 'docker push ghcr.io/opswalrus/ops:latest' }
@@ -427,7 +427,7 @@ module OpsWalrus
427
427
  sudo_password_args = {}
428
428
  sudo_password_args[:sudo_password] = ssh_password unless ops_prompt_for_sudo_password
429
429
  sudo_password_args[:ops_sudo_password] = ssh_password if ops_prompt_for_sudo_password
430
- @runtime_env.handle_input(input_mapping, **sudo_password_args) do |interaction_handler|
430
+ @runtime_env.handle_input(input_mapping, **sudo_password_args, inherit_existing_mappings: false) do |interaction_handler|
431
431
  # @sshkit_backend.capture(*args, interaction_handler: interaction_handler, verbosity: SSHKit.config.output_verbosity)
432
432
  App.instance.debug("Host#execute_cmd(#{args.inspect}) with input mappings #{interaction_handler.input_mappings.inspect} given sudo_password_args: #{sudo_password_args.inspect})")
433
433
  @sshkit_backend.capture(*args, interaction_handler: interaction_handler)
@@ -443,7 +443,7 @@ module OpsWalrus
443
443
  sudo_password_args = {}
444
444
  sudo_password_args[:sudo_password] = ssh_password unless ops_prompt_for_sudo_password
445
445
  sudo_password_args[:ops_sudo_password] = ssh_password if ops_prompt_for_sudo_password
446
- @runtime_env.handle_input(input_mapping, **sudo_password_args) do |interaction_handler|
446
+ @runtime_env.handle_input(input_mapping, **sudo_password_args, inherit_existing_mappings: false) do |interaction_handler|
447
447
  App.instance.debug("Host#execute_cmd(#{args.inspect}) with input mappings #{interaction_handler.input_mappings.inspect} given sudo_password_args: #{sudo_password_args.inspect})")
448
448
  @sshkit_backend.execute_cmd(*args, interaction_handler: interaction_handler)
449
449
  end
@@ -33,7 +33,7 @@ module OpsWalrus
33
33
  # when the given block returns, then the temporary mapping is removed from the interaction handler
34
34
  #
35
35
  # mapping : Hash[ String | Regex => String ] | Nil
36
- def with_mapping(mapping = nil, sudo_password: nil, ops_sudo_password: nil, inherit_existing_mappings: false)
36
+ def with_mapping(mapping = nil, sudo_password: nil, ops_sudo_password: nil, inherit_existing_mappings: true)
37
37
  new_mapping = inherit_existing_mappings ? @input_mappings : {}
38
38
 
39
39
  if mapping
@@ -264,9 +264,10 @@ module OpsWalrus
264
264
  out, err, exit_status = if App.instance.dry_run?
265
265
  ["", "", 0]
266
266
  else
267
- sshkit_cmd = @runtime_env.handle_input(input) do |interaction_handler|
267
+ sshkit_cmd = @runtime_env.handle_input(input, inherit_existing_mappings: true) do |interaction_handler|
268
268
  # self is a Module instance that is serving as the evaluation context in an instance of a subclass of an Invocation; see Invocation#evaluate
269
269
  # backend.execute_cmd(cmd, interaction_handler: interaction_handler, verbosity: SSHKit.config.output_verbosity)
270
+ App.instance.debug("OpsFileScriptDSL#shell! cmd=#{cmd} with input mappings #{interaction_handler.input_mappings.inspect} given input: #{input.inspect})")
270
271
  backend.execute_cmd(cmd, interaction_handler: interaction_handler)
271
272
  end
272
273
  [sshkit_cmd.full_stdout, sshkit_cmd.full_stderr, sshkit_cmd.exit_status]
@@ -258,7 +258,7 @@ module OpsWalrus
258
258
 
259
259
  # input_mapping : Hash[ String | Regex => String ]
260
260
  # sudo_password : String
261
- def handle_input(input_mapping, sudo_password: nil, ops_sudo_password: nil, inherit_existing_mappings: false, &block)
261
+ def handle_input(input_mapping, sudo_password: nil, ops_sudo_password: nil, inherit_existing_mappings: true, &block)
262
262
  @interaction_handler.with_mapping(
263
263
  input_mapping,
264
264
  sudo_password: sudo_password,
@@ -1,3 +1,3 @@
1
1
  module OpsWalrus
2
- VERSION = "1.0.43"
2
+ VERSION = "1.0.44"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opswalrus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.43
4
+ version: 1.0.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Ellis