rundock 1.1.1 → 1.1.2

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: e9d5fbdbec3793e39aa69bf57a931215bedf4c98
4
- data.tar.gz: 1301a6b4db8220b709225b34d4851a73e97033aa
3
+ metadata.gz: 7879491846da01dd89f32447e3d005ff6a605a4d
4
+ data.tar.gz: 9ca056e0dea037fc0d282c52425064558b14b7d7
5
5
  SHA512:
6
- metadata.gz: 78e493176f50ebb48ae7817f6180de0624743bc0f714f8acaaebed3b04b7a100ca40b72396355baea1a0e4791606258f2a527b17b53a28271eb23c4bfc620837
7
- data.tar.gz: a9b0c2565b7444383545cecc1ade484a447cb0869fe51be6e2c95ee21255cddeddcd9ca6264a004f80dc5d62f27ca32ef65f179fed922f356131df3ce3d061b5
6
+ metadata.gz: 0339360367affaea08aa104c30111fddbce757581b90a12fca1a6864c44e9181d1dd7cd1750ea1faf1adafbddc5e15513d28a302600fd4fc609f7b94244d6070
7
+ data.tar.gz: d6af35bfaba87880eff13126372b0d27ac83de9f3511da109327e0567a81268604ee8e6702e9efb1c7a99beabc67e4114067400d6534fed305706f1d7fcb019e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v1.1.2
2
+
3
+ Update
4
+
5
+ - Support deploy arguments to deploy operation
6
+
1
7
  ## v1.1.1
2
8
 
3
9
  Update
@@ -22,9 +22,9 @@ module Rundock
22
22
  Logger.send(severity.to_sym, "#{h_host} #{h_ope} #{message}")
23
23
  end
24
24
 
25
- def assign_args(cmd, args)
26
- return cmd unless args
27
- cmd.gsub(/\$#/, args.length.to_s)
25
+ def assign_args(src, args)
26
+ return src unless args
27
+ src.gsub(/\$#/, args.length.to_s)
28
28
  .gsub(/\$@/, args.join(' '))
29
29
  .gsub(/\$[1-9]/) { |arg_n| args[arg_n.chars[1..-1].join.to_i - 1] }
30
30
  .gsub(/(\$\{)(\w+)(\})/) { ENV[Regexp.last_match(2)] }
@@ -3,9 +3,16 @@ module Rundock
3
3
  class Task < Base
4
4
  def run(backend, attributes = {})
5
5
  @instruction.each do |i|
6
+ previous_args = attributes[:task_args]
6
7
  task_set = i.split(' ')
7
8
  task_name = task_set.first
8
- attributes[:task_args] = task_set.slice(1..-1) if task_set.length > 1
9
+
10
+ if task_set.length > 1
11
+ attributes[:task_args] = task_set.slice(1..-1).map do |arg|
12
+ assign_args(arg, previous_args)
13
+ end
14
+ end
15
+
9
16
  unless attributes[:task_info].key?(task_name.to_sym)
10
17
  Logger.warn("task not found and ignored: #{task_name}")
11
18
  next
@@ -1,3 +1,3 @@
1
1
  module Rundock
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
@@ -0,0 +1,16 @@
1
+ - target: localhost
2
+ command:
3
+ - "rm -f /var/tmp/hello_rundock_from_deploy_src_file_c_d_a_b_scenario"
4
+ - "rm -f /var/tmp/hello_rundock_from_deploy_dst_file_a_b_c_d_scenario"
5
+ - "echo 'Hello Rundock from deploy recursive Scenario.' > /var/tmp/hello_rundock_from_deploy_src_file_c_d_a_b_scenario"
6
+ task:
7
+ - deploy_file_1 a b
8
+ ---
9
+ ---
10
+ deploy_file_1:
11
+ task:
12
+ deploy_file_2 c d $1 $2
13
+ deploy_file_2:
14
+ deploy:
15
+ - src: /var/tmp/hello_rundock_from_deploy_src_file_$1_$2_$3_$4_scenario
16
+ dst: /var/tmp/hello_rundock_from_deploy_dst_file_$3_$4_$1_$2_scenario
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+
3
+ describe file('/var/tmp/hello_rundock_from_deploy_dst_file_a_b_c_d_scenario') do
4
+ it { should be_file }
5
+ its(:content) { should match(/Hello Rundock from deploy recursive Scenario./) }
6
+ end
@@ -0,0 +1,24 @@
1
+ - target: localhost
2
+ command:
3
+ - "rm -f /var/tmp/hello_rundock_from_deploy_src_file_c_d_a_b_scenario"
4
+ - "echo 'Hello Rundock from deploy recursive Scenario.' > /var/tmp/hello_rundock_from_deploy_src_file_c_d_a_b_scenario"
5
+ - target: anyhost-01
6
+ command:
7
+ - "rm -f /var/tmp/hello_rundock_from_deploy_dst_file_a_b_c_d_scenario"
8
+ task:
9
+ - deploy_task_1 a b
10
+ ---
11
+ anyhost-01:
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
+ deploy_task_1:
19
+ task:
20
+ deploy_task_2 c d $1 $2
21
+ deploy_task_2:
22
+ deploy:
23
+ - src: /var/tmp/hello_rundock_from_deploy_src_file_$1_$2_$3_$4_scenario
24
+ dst: /var/tmp/hello_rundock_from_deploy_dst_file_$3_$4_$1_$2_scenario
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.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - hiracy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-10 00:00:00.000000000 Z
11
+ date: 2018-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -211,6 +211,7 @@ files:
211
211
  - spec/integration/platforms/localhost/scenarios/cwd_scenario.yml
212
212
  - spec/integration/platforms/localhost/scenarios/deploy_args_scenario.yml
213
213
  - spec/integration/platforms/localhost/scenarios/deploy_erb_scenario.yml
214
+ - spec/integration/platforms/localhost/scenarios/deploy_recursive_scenario.yml
214
215
  - spec/integration/platforms/localhost/scenarios/deploy_scenario.yml
215
216
  - spec/integration/platforms/localhost/scenarios/file_hooks_by_option_scenario.yml
216
217
  - spec/integration/platforms/localhost/scenarios/file_hooks_scenario.yml
@@ -227,6 +228,7 @@ files:
227
228
  - spec/integration/recipes/cwd_spec.rb
228
229
  - spec/integration/recipes/deploy_args_spec.rb
229
230
  - spec/integration/recipes/deploy_erb_spec.rb
231
+ - spec/integration/recipes/deploy_recursive_spec.rb
230
232
  - spec/integration/recipes/deploy_spec.rb
231
233
  - spec/integration/recipes/file_hook_by_option_spec.rb
232
234
  - spec/integration/recipes/file_hook_spec.rb
@@ -242,6 +244,7 @@ files:
242
244
  - spec/integration/scenarios/cwd_scenario.yml
243
245
  - spec/integration/scenarios/deploy_args_scenario.yml
244
246
  - spec/integration/scenarios/deploy_erb_scenario.yml
247
+ - spec/integration/scenarios/deploy_recursive_scenario.yml
245
248
  - spec/integration/scenarios/deploy_scenario.yml
246
249
  - spec/integration/scenarios/file_hooks_by_option_scenario.yml
247
250
  - spec/integration/scenarios/file_hooks_scenario.yml