rundock 1.1.6 → 1.1.7
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/Rakefile +4 -0
- data/lib/rundock/backend.rb +2 -0
- data/lib/rundock/cli.rb +2 -0
- data/lib/rundock/logger.rb +7 -1
- data/lib/rundock/version.rb +1 -1
- data/spec/integration/platforms/localhost/scenarios/task_with_filtering_scenario.yml +23 -0
- data/spec/integration/platforms/localhost/scenarios/task_with_merging_scenario.yml +12 -0
- data/spec/integration/recipes/task_with_filtering_spec.rb +19 -0
- data/spec/integration/recipes/task_with_merging_spec.rb +11 -0
- data/spec/integration/scenarios/task_with_filtering_scenario.yml +30 -0
- data/spec/integration/scenarios/task_with_merging_scenario.yml +19 -0
- data/spec/integration/tasks/task_with_merging.yml +3 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41eab756e59dece15df6f146b5e1c7bfe5130165
|
4
|
+
data.tar.gz: e06935ab43506d934940fead88343ac6b2f28f8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8b825b2ba472f9acdd8e0a0a640ce53ba2c9fc2fdc0b65ddc25a020a2eb47b09d4d953104ab3d3d6d3724b8fed50df88fc55e4873ac2fec599aab3b11d64fb6
|
7
|
+
data.tar.gz: 1612a61ce7d34945b7782bfa16fde756a5b8426bd06ecb2b4354c7bbb3f57b04d580ebf44c03f359fb410f17ce7f2a644bae259fb6077fb4ebb3740ac9bf447b
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -83,6 +83,10 @@ def do_rundock_scenarios(platform)
|
|
83
83
|
options = " -t ./spec/integration/tasks/#{Regexp.last_match(1)}.yml"
|
84
84
|
elsif scenario =~ %r{^*scenarios/(.*target_by_option)_scenario.yml$}
|
85
85
|
options = " -g #{base_dir}/targets/#{Regexp.last_match(1)}.yml"
|
86
|
+
elsif scenario =~ %r{^*scenarios/(.*task_with_filtering)_scenario.yml$}
|
87
|
+
options = ' -T do_task_1,do_task_2'
|
88
|
+
elsif scenario =~ %r{^*scenarios/(.*task_with_merging)_scenario.yml$}
|
89
|
+
options = " -t ./spec/integration/tasks/#{Regexp.last_match(1)}.yml"
|
86
90
|
end
|
87
91
|
|
88
92
|
execute('bundle exec exe/rundock' \
|
data/lib/rundock/backend.rb
CHANGED
@@ -78,6 +78,8 @@ module Rundock
|
|
78
78
|
Logger.debug("exit status: #{exit_status}")
|
79
79
|
end
|
80
80
|
|
81
|
+
Logger.formatter.simple_output(result.stdout.strip) if Logger.formatter.suppress_logging && !result.stdout.strip.blank?
|
82
|
+
|
81
83
|
raise CommandResultStatusError if exec_options[:errexit] && exit_status != 0
|
82
84
|
|
83
85
|
result
|
data/lib/rundock/cli.rb
CHANGED
@@ -12,6 +12,7 @@ module Rundock
|
|
12
12
|
class_option :header, type: :boolean, default: true
|
13
13
|
class_option :short_header, type: :boolean, default: false
|
14
14
|
class_option :date_header, type: :boolean, default: true
|
15
|
+
class_option :suppress_logging, type: :boolean, default: false
|
15
16
|
|
16
17
|
def initialize(args, opts, config)
|
17
18
|
super(args, opts, config)
|
@@ -21,6 +22,7 @@ module Rundock
|
|
21
22
|
Rundock::Logger.formatter.show_header = options[:header]
|
22
23
|
Rundock::Logger.formatter.short_header = options[:short_header]
|
23
24
|
Rundock::Logger.formatter.date_header = options[:date_header]
|
25
|
+
Rundock::Logger.formatter.suppress_logging = options[:suppress_logging]
|
24
26
|
end
|
25
27
|
|
26
28
|
desc 'version', 'Print version'
|
data/lib/rundock/logger.rb
CHANGED
@@ -33,6 +33,7 @@ module Rundock
|
|
33
33
|
attr_accessor :show_header
|
34
34
|
attr_accessor :short_header
|
35
35
|
attr_accessor :date_header
|
36
|
+
attr_accessor :suppress_logging
|
36
37
|
attr_accessor :buffer
|
37
38
|
|
38
39
|
def initialize(*args)
|
@@ -100,8 +101,13 @@ module Rundock
|
|
100
101
|
@lock = false
|
101
102
|
end
|
102
103
|
|
104
|
+
def simple_output(msg)
|
105
|
+
puts msg2str(msg)
|
106
|
+
end
|
107
|
+
|
103
108
|
def formatted_message(severity, datetime, progname, msg)
|
104
|
-
out = if
|
109
|
+
out = if @suppress_logging
|
110
|
+
elsif !@show_header
|
105
111
|
"%s\n" % [msg2str(msg)]
|
106
112
|
elsif !@date_header
|
107
113
|
"%5s: %s%s\n" % [
|
data/lib/rundock/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
- target: localhost
|
2
|
+
command:
|
3
|
+
- "rm -rf /var/tmp/hello_rundock_from_task_with_filtering"
|
4
|
+
task:
|
5
|
+
- do_task_1
|
6
|
+
- do_not_task_1
|
7
|
+
- do_task_2
|
8
|
+
- do_not_task_2
|
9
|
+
---
|
10
|
+
---
|
11
|
+
do_task_1:
|
12
|
+
command:
|
13
|
+
- mkdir /var/tmp/hello_rundock_from_task_with_filtering
|
14
|
+
- echo 'Hello Rundock from task with filtering do task 1.' > /var/tmp/hello_rundock_from_task_with_filtering/do_task_1
|
15
|
+
do_not_task_1:
|
16
|
+
command:
|
17
|
+
- echo 'Hello Rundock from task with filtering do not task 1.' > /var/tmp/hello_rundock_from_task_with_filtering/do_not_task_1
|
18
|
+
do_task_2:
|
19
|
+
command:
|
20
|
+
- echo 'Hello Rundock from task with filtering do task 2.' > /var/tmp/hello_rundock_from_task_with_filtering/do_task_2
|
21
|
+
do_not_task_2:
|
22
|
+
command:
|
23
|
+
- echo 'Hello Rundock from task with filtering do not task 2.' > /var/tmp/hello_rundock_from_task_with_filtering/do_not_task_2
|
@@ -0,0 +1,12 @@
|
|
1
|
+
- target: localhost
|
2
|
+
command:
|
3
|
+
- "rm -rf /var/tmp/hello_rundock_from_task_with_merging"
|
4
|
+
task:
|
5
|
+
- do_task_1
|
6
|
+
- do_task_2
|
7
|
+
---
|
8
|
+
---
|
9
|
+
do_task_1:
|
10
|
+
command:
|
11
|
+
- mkdir /var/tmp/hello_rundock_from_task_with_merging
|
12
|
+
- echo 'Hello Rundock from task with merging do task 1.' > /var/tmp/hello_rundock_from_task_with_merging/do_task_1
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe file('/var/tmp/hello_rundock_from_task_with_filtering/do_task_1') do
|
4
|
+
it { should be_file }
|
5
|
+
its(:content) { should match(/Hello Rundock from task with filtering do task 1/) }
|
6
|
+
end
|
7
|
+
|
8
|
+
describe file('/var/tmp/hello_rundock_from_task_with_filtering/do_task_2') do
|
9
|
+
it { should be_file }
|
10
|
+
its(:content) { should match(/Hello Rundock from task with filtering do task 2/) }
|
11
|
+
end
|
12
|
+
|
13
|
+
describe file('/var/tmp/hello_rundock_from_task_with_filtering/do_not_task_1') do
|
14
|
+
it { should_not be_file }
|
15
|
+
end
|
16
|
+
|
17
|
+
describe file('/var/tmp/hello_rundock_from_task_with_filtering/do_not_task_2') do
|
18
|
+
it { should_not be_file }
|
19
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe file('/var/tmp/hello_rundock_from_task_with_merging/do_task_1') do
|
4
|
+
it { should be_file }
|
5
|
+
its(:content) { should match(/Hello Rundock from task with merging do task 1/) }
|
6
|
+
end
|
7
|
+
|
8
|
+
describe file('/var/tmp/hello_rundock_from_task_with_merging/do_task_2') do
|
9
|
+
it { should be_file }
|
10
|
+
its(:content) { should match(/Hello Rundock from task with merging do task 2/) }
|
11
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
- target: anyhost-01
|
2
|
+
command:
|
3
|
+
- "rm -rf /var/tmp/hello_rundock_from_task_with_filtering"
|
4
|
+
task:
|
5
|
+
- do_task_1
|
6
|
+
- do_not_task_1
|
7
|
+
- do_task_2
|
8
|
+
- do_not_task_2
|
9
|
+
---
|
10
|
+
anyhost-01:
|
11
|
+
target_type: host
|
12
|
+
host: <replaced_by_platforms_host>
|
13
|
+
ssh_opts:
|
14
|
+
port: <replaced_by_platforms_port>
|
15
|
+
user: tester
|
16
|
+
key: "<replaced_by_platforms_key>"
|
17
|
+
---
|
18
|
+
do_task_1:
|
19
|
+
command:
|
20
|
+
- mkdir /var/tmp/hello_rundock_from_task_with_filtering
|
21
|
+
- echo 'Hello Rundock from task with filtering do task 1.' > /var/tmp/hello_rundock_from_task_with_filtering/do_task_1
|
22
|
+
do_not_task_1:
|
23
|
+
command:
|
24
|
+
- echo 'Hello Rundock from task with filtering do not task 1.' > /var/tmp/hello_rundock_from_task_with_filtering/do_not_task_1
|
25
|
+
do_task_2:
|
26
|
+
command:
|
27
|
+
- echo 'Hello Rundock from task with filtering do task 2.' > /var/tmp/hello_rundock_from_task_with_filtering/do_task_2
|
28
|
+
do_not_task_2:
|
29
|
+
command:
|
30
|
+
- echo 'Hello Rundock from task with filtering do not task 2.' > /var/tmp/hello_rundock_from_task_with_filtering/do_not_task_2
|
@@ -0,0 +1,19 @@
|
|
1
|
+
- target: anyhost-01
|
2
|
+
command:
|
3
|
+
- "rm -rf /var/tmp/hello_rundock_from_task_with_merging"
|
4
|
+
task:
|
5
|
+
- do_task_1
|
6
|
+
- do_task_2
|
7
|
+
---
|
8
|
+
anyhost-01:
|
9
|
+
target_type: host
|
10
|
+
host: <replaced_by_platforms_host>
|
11
|
+
ssh_opts:
|
12
|
+
port: <replaced_by_platforms_port>
|
13
|
+
user: tester
|
14
|
+
key: "<replaced_by_platforms_key>"
|
15
|
+
---
|
16
|
+
do_task_1:
|
17
|
+
command:
|
18
|
+
- mkdir /var/tmp/hello_rundock_from_task_with_merging
|
19
|
+
- echo 'Hello Rundock from task with merging do task 1.' > /var/tmp/hello_rundock_from_task_with_merging/do_task_1
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rundock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hiracy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -223,6 +223,8 @@ files:
|
|
223
223
|
- spec/integration/platforms/localhost/scenarios/target_group_scenario.yml
|
224
224
|
- spec/integration/platforms/localhost/scenarios/task_by_option_scenario.yml
|
225
225
|
- spec/integration/platforms/localhost/scenarios/task_with_args_scenario.yml
|
226
|
+
- spec/integration/platforms/localhost/scenarios/task_with_filtering_scenario.yml
|
227
|
+
- spec/integration/platforms/localhost/scenarios/task_with_merging_scenario.yml
|
226
228
|
- spec/integration/platforms/localhost/scenarios/task_with_recursive_args_scenario.yml
|
227
229
|
- spec/integration/platforms/localhost/scenarios/use_default_ssh_scenario.yml
|
228
230
|
- spec/integration/platforms/localhost/targets/target_by_option.yml
|
@@ -241,6 +243,8 @@ files:
|
|
241
243
|
- spec/integration/recipes/target_by_option_spec.rb
|
242
244
|
- spec/integration/recipes/task_by_option_spec.rb
|
243
245
|
- spec/integration/recipes/task_with_args_spec.rb
|
246
|
+
- spec/integration/recipes/task_with_filtering_spec.rb
|
247
|
+
- spec/integration/recipes/task_with_merging_spec.rb
|
244
248
|
- spec/integration/recipes/task_with_recursive_args_spec.rb
|
245
249
|
- spec/integration/scenarios/all_file_hooks_by_option_scenario.yml
|
246
250
|
- spec/integration/scenarios/cwd_scenario.yml
|
@@ -257,11 +261,14 @@ files:
|
|
257
261
|
- spec/integration/scenarios/target_group_scenario.yml
|
258
262
|
- spec/integration/scenarios/task_by_option_scenario.yml
|
259
263
|
- spec/integration/scenarios/task_with_args_scenario.yml
|
264
|
+
- spec/integration/scenarios/task_with_filtering_scenario.yml
|
265
|
+
- spec/integration/scenarios/task_with_merging_scenario.yml
|
260
266
|
- spec/integration/scenarios/task_with_recursive_args_scenario.yml
|
261
267
|
- spec/integration/scenarios/use_default_ssh_scenario.yml
|
262
268
|
- spec/integration/spec_helper.rb
|
263
269
|
- spec/integration/targets/target_by_option.yml
|
264
270
|
- spec/integration/tasks/task_by_option.yml
|
271
|
+
- spec/integration/tasks/task_with_merging.yml
|
265
272
|
homepage: https://github.com/hiracy/rundock
|
266
273
|
licenses:
|
267
274
|
- MIT
|