rundock 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 427a5c5bf1af65355a3fd503eafb597c152db37e
4
- data.tar.gz: 4d518a9ce6c376fe2b0fa18c5528c24927d6fac9
3
+ metadata.gz: 718bf71616360d5ef7fcd4f101327d27c5b93338
4
+ data.tar.gz: 8a7988875fe45b1f7ae288dd7663e0179d203019
5
5
  SHA512:
6
- metadata.gz: 9f28cd34e259c5c6537016a32cc8c11190898328584c6d48548651b659986a57db9231b1e95d739750b1d493b5c1930ed0237484bcfcab07253ef58e82e014f9
7
- data.tar.gz: edb622626765bd919c198f4ae289e79346b5001f6cc2de03458588de1fbbba7f6ecc67e4f1d9e5802604fcdc9caa15dc5b2e0c474088772cc4a0c007fcb7261d
6
+ metadata.gz: a73393c18bbe1cd693464cd209e070bbb8d690b28f2aaf2008b0d6355757f483f490bc3ddcce4ffdc6acb5211ec4a53c523442da1afdd51fe5247375f86a6870
7
+ data.tar.gz: 3f07d87fef9fe10c50a279feee52da7d15a4c65ee4fd225154fa3e8dd19098f45198abe3012d4da6a7377ba6db53c58b798759d103fcb069d69e370b6a14f6a4
data/CHANGELOG.md CHANGED
@@ -1,8 +1,9 @@
1
- ## v1.1.3
1
+ ## v1.1.4
2
2
 
3
3
  Update
4
4
 
5
5
  - Support simple string replace to deploy erb operation
6
+ - Support binding argument to deploy erb operation
6
7
 
7
8
  ## v1.1.2
8
9
 
@@ -64,7 +64,7 @@ module Rundock
64
64
  Logger.debug("deploy erb binding: #{opt[:binding]}") if is_erb
65
65
 
66
66
  val_binding = if is_erb
67
- extract_map(backend, opt[:binding])
67
+ extract_map(backend, opt[:binding], attributes[:task_args])
68
68
  else
69
69
  {}
70
70
  end
@@ -104,20 +104,23 @@ module Rundock
104
104
  end
105
105
  end
106
106
 
107
- def extract_map(backend, binding)
107
+ def extract_map(backend, binding, args)
108
108
  map = {}
109
109
  binding.each do |k, v|
110
110
  next unless v.key?(:value)
111
+ bind_key = assign_args(k.to_s, args)
112
+ bind_type = assign_args(v[:type].to_s, args)
113
+ bind_value = assign_args(v[:value].to_s, args)
111
114
 
112
115
  # write types other than the command here
113
- map[k] = case v[:type].to_s
114
- when 'command'
115
- backend.specinfra_run_command(v[:value]).stdout.strip
116
- when 'string'
117
- v[:value]
118
- else
119
- v[:value]
120
- end
116
+ map[bind_key] = case bind_type
117
+ when 'command'
118
+ backend.specinfra_run_command(bind_value).stdout.strip
119
+ when 'string'
120
+ bind_value
121
+ else
122
+ bind_value
123
+ end
121
124
  end
122
125
 
123
126
  map
@@ -1,3 +1,3 @@
1
1
  module Rundock
2
- VERSION = '1.1.3'
2
+ VERSION = '1.1.4'
3
3
  end
@@ -3,11 +3,24 @@
3
3
  - "rm -f /var/tmp/hello_rundock_from_deploy_src_file_arg_1_scenario"
4
4
  - "rm -f /var/tmp/hello_rundock_from_deploy_dst_file_arg_2_scenario"
5
5
  - "echo 'Hello Rundock from deploy args Scenario.' > /var/tmp/hello_rundock_from_deploy_src_file_arg_1_scenario"
6
+ - "rm -f /var/tmp/hello_rundock_from_deploy_src_file_arg_binding_scenario"
7
+ - "rm -f /var/tmp/hello_rundock_from_deploy_dst_file_arg_binding_scenario"
8
+ - "echo 'Hello Rundock from deploy args <%= arg_1 %> Scenario.' > /var/tmp/hello_rundock_from_deploy_src_file_arg_binding_scenario"
6
9
  task:
7
- - deploy_file arg_1 arg_2
10
+ - deploy_file arg_1 arg_2
11
+ - deploy_file_binding arg_1 runrunrundock
8
12
  ---
9
13
  ---
10
14
  deploy_file:
11
15
  deploy:
12
16
  - src: /var/tmp/hello_rundock_from_deploy_src_file_$1_scenario
13
17
  dst: /var/tmp/hello_rundock_from_deploy_dst_file_$2_scenario
18
+ deploy_file_binding:
19
+ deploy:
20
+ - src: /var/tmp/hello_rundock_from_deploy_src_file_arg_binding_scenario
21
+ dst: /var/tmp/hello_rundock_from_deploy_dst_file_arg_binding_scenario
22
+ erb: true
23
+ binding:
24
+ $1:
25
+ type: string
26
+ value: $2
@@ -4,3 +4,8 @@ describe file('/var/tmp/hello_rundock_from_deploy_dst_file_arg_2_scenario') do
4
4
  it { should be_file }
5
5
  its(:content) { should match(/Hello Rundock from deploy args Scenario./) }
6
6
  end
7
+
8
+ describe file('/var/tmp/hello_rundock_from_deploy_dst_file_arg_binding_scenario') do
9
+ it { should be_file }
10
+ its(:content) { should match(/Hello Rundock from deploy args runrunrundock Scenario./) }
11
+ end
@@ -2,11 +2,15 @@
2
2
  command:
3
3
  - "rm -f /var/tmp/hello_rundock_from_deploy_src_file_arg_1_scenario"
4
4
  - "echo 'Hello Rundock from deploy args Scenario.' > /var/tmp/hello_rundock_from_deploy_src_file_arg_1_scenario"
5
+ - "rm -f /var/tmp/hello_rundock_from_deploy_src_file_arg_binding_scenario"
6
+ - "echo 'Hello Rundock from deploy args <%= arg_1 %> Scenario.' > /var/tmp/hello_rundock_from_deploy_src_file_arg_binding_scenario"
5
7
  - target: anyhost-01
6
8
  command:
7
9
  - "rm -f /var/tmp/hello_rundock_from_deploy_dst_file_arg_2_scenario"
10
+ - "rm -f /var/tmp/hello_rundock_from_deploy_dst_file_arg_binding_scenario"
8
11
  task:
9
- - deploy_task arg_1 arg_2
12
+ - deploy_task arg_1 arg_2
13
+ - deploy_task_binding arg_1 runrunrundock
10
14
  ---
11
15
  anyhost-01:
12
16
  host: <replaced_by_platforms_host>
@@ -19,3 +23,12 @@ deploy_task:
19
23
  deploy:
20
24
  - src: /var/tmp/hello_rundock_from_deploy_src_file_$1_scenario
21
25
  dst: /var/tmp/hello_rundock_from_deploy_dst_file_$2_scenario
26
+ deploy_task_binding:
27
+ deploy:
28
+ - src: /var/tmp/hello_rundock_from_deploy_src_file_arg_binding_scenario
29
+ dst: /var/tmp/hello_rundock_from_deploy_dst_file_arg_binding_scenario
30
+ erb: true
31
+ binding:
32
+ $1:
33
+ type: string
34
+ value: $2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rundock
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - hiracy