opswalrus 1.0.43 → 1.0.45
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/build.ops +1 -1
- data/lib/opswalrus/host.rb +2 -2
- data/lib/opswalrus/interaction_handlers.rb +1 -1
- data/lib/opswalrus/ops_file_script_dsl.rb +2 -1
- data/lib/opswalrus/runtime_environment.rb +1 -1
- data/lib/opswalrus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab0f69f8661c6d29f48d0ad70f4046b6d53a3dbe167958668e09005b2086f175
|
4
|
+
data.tar.gz: 5159cfc4bb7cb0ed366b9f3197d3926c77bd22a6482f2a376c9f6baf4fb36238
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 445960c704e60c61b49a54eb3ea9950fda2f8b0c124bb7d7876849a5d9985fc3eeba80d907d6fb0a90305eff6139bfde886756bdf5dc2d43b04685191dd872ad
|
7
|
+
data.tar.gz: c78e9d383c7f9351d47b67b92664d5e407344ed305fc78bc15fb74829a68033c7d0f754c8f1e5d26ab06d61325a6ba9a09d7f9324d5676ec08008dd9b6d497d2
|
data/Gemfile.lock
CHANGED
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: {
|
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' }
|
data/lib/opswalrus/host.rb
CHANGED
@@ -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:
|
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:
|
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,
|
data/lib/opswalrus/version.rb
CHANGED