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 +4 -4
- data/CHANGELOG.md +2 -1
- data/lib/rundock/plugin/operation/deploy.rb +13 -10
- data/lib/rundock/version.rb +1 -1
- data/spec/integration/platforms/localhost/scenarios/deploy_args_scenario.yml +14 -1
- data/spec/integration/recipes/deploy_args_spec.rb +5 -0
- data/spec/integration/scenarios/deploy_args_scenario.yml +14 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 718bf71616360d5ef7fcd4f101327d27c5b93338
|
4
|
+
data.tar.gz: 8a7988875fe45b1f7ae288dd7663e0179d203019
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a73393c18bbe1cd693464cd209e070bbb8d690b28f2aaf2008b0d6355757f483f490bc3ddcce4ffdc6acb5211ec4a53c523442da1afdd51fe5247375f86a6870
|
7
|
+
data.tar.gz: 3f07d87fef9fe10c50a279feee52da7d15a4c65ee4fd225154fa3e8dd19098f45198abe3012d4da6a7377ba6db53c58b798759d103fcb069d69e370b6a14f6a4
|
data/CHANGELOG.md
CHANGED
@@ -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[
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
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
|
data/lib/rundock/version.rb
CHANGED
@@ -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
|
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
|
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
|