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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87276a62d3a318643a6fd4e1db23ef2bc8734406
4
- data.tar.gz: 41189493f366d574722b6342fa5b325c33e4e8ee
3
+ metadata.gz: 41eab756e59dece15df6f146b5e1c7bfe5130165
4
+ data.tar.gz: e06935ab43506d934940fead88343ac6b2f28f8c
5
5
  SHA512:
6
- metadata.gz: 62eb6c047d635fdd4af13f00cec08f776c254f0a260c9da20ddae46a5debdea17ba9be90928b207e29560d67cf12e4a501bbd0d297980c3020326f94664b3222
7
- data.tar.gz: 972d42c65730a9e5ba759135603e4c5ff56dda98d724540903de8122bdbf4892297816ba57f62bfa2be29304e711e8b62f4c3faa71f6e1df5e2b64119e948881
6
+ metadata.gz: c8b825b2ba472f9acdd8e0a0a640ce53ba2c9fc2fdc0b65ddc25a020a2eb47b09d4d953104ab3d3d6d3724b8fed50df88fc55e4873ac2fec599aab3b11d64fb6
7
+ data.tar.gz: 1612a61ce7d34945b7782bfa16fde756a5b8426bd06ecb2b4354c7bbb3f57b04d580ebf44c03f359fb410f17ce7f2a644bae259fb6077fb4ebb3740ac9bf447b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v1.1.7
2
+
3
+ Update
4
+
5
+ - Support multi external task file
6
+
1
7
  ## v1.1.6
2
8
 
3
9
  Fix
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' \
@@ -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'
@@ -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 !@show_header
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" % [
@@ -1,3 +1,3 @@
1
1
  module Rundock
2
- VERSION = '1.1.6'
2
+ VERSION = '1.1.7'
3
3
  end
@@ -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
@@ -0,0 +1,3 @@
1
+ do_task_2:
2
+ command:
3
+ - echo 'Hello Rundock from task with merging do task 2.' > /var/tmp/hello_rundock_from_task_with_merging/do_task_2
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.6
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-02 00:00:00.000000000 Z
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