jackal-stacks 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/jackal-stacks.rb +5 -1
- data/lib/jackal-stacks/builder.rb +13 -13
- data/lib/jackal-stacks/stack_common.rb +9 -8
- data/lib/jackal-stacks/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7331be29e3c4592f1e4c524ffab3560693ebeed5
|
4
|
+
data.tar.gz: eb3236969e633ebb07a8363542d8aaec2ea61525
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ef673f4bc94b275c7ba8e53c6e70c8eeab9b5a30b135ef20487ec69ce2c657d9c6039ada30d08e70fb0fc15a980a85bea230a53d735edbd6ca68dfd58ef402a
|
7
|
+
data.tar.gz: 1303387ab2be6bf3d0118b9e562bac1f0d918e7b8eadf3ae0f677e9b5a76fd457b3ed31b300c4d896e374fbed67039f5902e641ece2c25893c564d03a398a13b
|
data/CHANGELOG.md
CHANGED
data/lib/jackal-stacks.rb
CHANGED
@@ -19,8 +19,12 @@ Jackal.service(
|
|
19
19
|
:orchestration__bucket_name => {
|
20
20
|
:description => 'Name of remote bucket used for infrastructure storage'
|
21
21
|
},
|
22
|
+
:orchestration__api__provider => {
|
23
|
+
:description => 'Remote orchestration provider',
|
24
|
+
:type => :string
|
25
|
+
},
|
22
26
|
:orchestration__api__credentials => {
|
23
|
-
:description => '
|
27
|
+
:description => 'Credentials for orchestration API access',
|
24
28
|
:type => :hash
|
25
29
|
},
|
26
30
|
:default_template_path => {
|
@@ -32,19 +32,6 @@ module Jackal
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
# @return [String] working directory
|
36
|
-
def working_directory
|
37
|
-
memoize(:working_directory, :direct) do
|
38
|
-
FileUtils.mkdir_p(dir = config.fetch(:working_directory, '/tmp/jackal-stack-builder'))
|
39
|
-
dir
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
# @return [String] fresh working directory
|
44
|
-
def workspace(payload)
|
45
|
-
File.join(working_directory, payload[:id])
|
46
|
-
end
|
47
|
-
|
48
35
|
# Build or update stacks
|
49
36
|
#
|
50
37
|
# @param message [Carnivore::Message]
|
@@ -165,6 +152,19 @@ module Jackal
|
|
165
152
|
args = build_stack_args(payload, directory)
|
166
153
|
stack_name = payload.get(:data, :stacks, :name)
|
167
154
|
Sfn::Command.const_get(action.to_s.capitalize).new(args, [stack_name]).execute!
|
155
|
+
wait_for_complete(stacks_api.stacks.get(stack_name))
|
156
|
+
true
|
157
|
+
end
|
158
|
+
|
159
|
+
# Wait for stack to reach a completion state
|
160
|
+
#
|
161
|
+
# @param stack [Miasma::Models::Orchestration::Stack]
|
162
|
+
# @return [TrueClass]
|
163
|
+
def wait_for_complete(stack)
|
164
|
+
until(stack.state.to_s.donwcase.end_with?('complete') || stack.state.to_s.donwcase.end_with?('failed'))
|
165
|
+
sleep(10)
|
166
|
+
stack.reload
|
167
|
+
end
|
168
168
|
true
|
169
169
|
end
|
170
170
|
|
@@ -6,17 +6,18 @@ module Jackal
|
|
6
6
|
|
7
7
|
# @return [Miasma::Models::Orchestration]
|
8
8
|
def stacks_api
|
9
|
-
memoize(:stacks_api,
|
10
|
-
Miasma.api(
|
11
|
-
config.fetch(
|
12
|
-
:orchestration, :api, Smash.new
|
13
|
-
).merge(
|
14
|
-
:type => :orchestration
|
15
|
-
)
|
16
|
-
)
|
9
|
+
memoize(:stacks_api, api_config.to_smash.checksum) do
|
10
|
+
Miasma.api(api_config)
|
17
11
|
end
|
18
12
|
end
|
19
13
|
|
14
|
+
# @return [Hash] API connection configuration
|
15
|
+
def api_config
|
16
|
+
config.fetch(:orchestration, :api, Smash.new).merge(
|
17
|
+
:type => :orchestration
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
20
21
|
# Determine namespace key to use for accessing parameters
|
21
22
|
#
|
22
23
|
# @param payload [Smash]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jackal-stacks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jackal
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
101
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.
|
102
|
+
rubygems_version: 2.4.8
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: Message processing helper
|