rivet 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +4 -0
- data/README.md +35 -4
- data/lib/rivet/as/autoscale.rb +7 -0
- data/lib/rivet/common/base_config.rb +5 -0
- data/lib/rivet/version.rb +1 -1
- data/spec/shared_examples/a_config.rb +19 -0
- 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: fa12652cc297ce7aff30bd474dd41e8dddcbcce7
|
4
|
+
data.tar.gz: 3276611cd502b7a0927b8261dfd3706de6f27fad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4353e43ef7b544efb5cd092b60390a50e265fac315394198a6df9d6e9dc3bb72c472419bd183309e0d8b92046f35ff62b414a3e17d5822cd26b32968981f1341
|
7
|
+
data.tar.gz: 3dfc0fb8fef331344f88b90119eaf2b486a230706dc485f81ef0fb3906cc1ddeba1dbd412c81426af83e45941c1a5a8df94f16871c563e5b7758064b1e6deb58
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -72,24 +72,52 @@ You can execute any arbitrary ruby you please inside of a rivet configuration.
|
|
72
72
|
|
73
73
|
Rivets built in commands:
|
74
74
|
|
75
|
-
path()
|
75
|
+
**path()**
|
76
76
|
|
77
77
|
- A function that returns the configuration directory path.
|
78
78
|
- optionally takes any number of strings as arguments and will return the configuration
|
79
79
|
path with those strings joined to it.
|
80
80
|
|
81
|
-
import(PATH)
|
81
|
+
**import(PATH)**
|
82
82
|
|
83
83
|
- A function that allows you to import other rivet configuration files
|
84
84
|
|
85
|
-
bootstrap
|
85
|
+
**bootstrap**
|
86
86
|
|
87
87
|
- provide this with a template file and a set of variables. The variables will
|
88
88
|
be made available to the template file provided. Rendered, and injected as EC2
|
89
89
|
user-data.
|
90
90
|
|
91
|
-
|
91
|
+
**post**
|
92
|
+
|
93
|
+
provides a mechansim for you to pass a ruby block to be executed after a sync
|
94
|
+
has completed. Behavior is different for autoscale and ec2
|
95
|
+
|
96
|
+
* EC2
|
97
|
+
|
98
|
+
After instances have been successfully created block will be called.
|
99
|
+
Instances method will be available inside the block and will contain an
|
100
|
+
array of instance id's.
|
101
|
+
|
102
|
+
```
|
103
|
+
post do
|
104
|
+
instances.each do |x|
|
105
|
+
puts x
|
106
|
+
end
|
107
|
+
end
|
108
|
+
```
|
109
|
+
|
110
|
+
* Autoscale
|
92
111
|
|
112
|
+
After the autoscaling group is synced the block will fire. No information is
|
113
|
+
currently passed in.
|
114
|
+
```
|
115
|
+
post do
|
116
|
+
puts "You gotta get schwifty in here"
|
117
|
+
end
|
118
|
+
```
|
119
|
+
|
120
|
+
Rivet will only use the following attributes.
|
93
121
|
|
94
122
|
Autoscale Options
|
95
123
|
```
|
@@ -157,6 +185,9 @@ Block device mappings should be an array of Hashes with the format:
|
|
157
185
|
no_device: String
|
158
186
|
}
|
159
187
|
```
|
188
|
+
|
189
|
+
|
190
|
+
|
160
191
|
Using the bootstrap functionality
|
161
192
|
---------------------------------
|
162
193
|
|
data/lib/rivet/as/autoscale.rb
CHANGED
@@ -28,11 +28,13 @@ module Rivet
|
|
28
28
|
]
|
29
29
|
|
30
30
|
attr_reader :name
|
31
|
+
attr_reader :post
|
31
32
|
|
32
33
|
def initialize(config)
|
33
34
|
@name = config.name
|
34
35
|
@remote_group = AwsAutoscaleWrapper.new(@name)
|
35
36
|
@launch_config = LaunchConfig.new(config)
|
37
|
+
@post = config.post
|
36
38
|
|
37
39
|
OPTIONS.each do |o|
|
38
40
|
if config.respond_to?(o)
|
@@ -106,6 +108,11 @@ module Rivet
|
|
106
108
|
else
|
107
109
|
Rivet::Log.info "No autoscale differences to sync to AWS for #{@name}."
|
108
110
|
end
|
111
|
+
# Post processing hooks
|
112
|
+
unless post.nil?
|
113
|
+
post_processing = OpenStruct.new
|
114
|
+
post_processing.instance_eval(&post)
|
115
|
+
end
|
109
116
|
end
|
110
117
|
|
111
118
|
protected
|
data/lib/rivet/version.rb
CHANGED
@@ -31,6 +31,25 @@ shared_examples_for "a config" do
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
describe '#post' do
|
35
|
+
context 'with no arguments' do
|
36
|
+
it 'returns nil' do
|
37
|
+
default_config.post.should == nil
|
38
|
+
end
|
39
|
+
end
|
40
|
+
context 'with arguments' do
|
41
|
+
it 'returns a callable proc' do
|
42
|
+
msg = "Yehaw"
|
43
|
+
default_config.post do
|
44
|
+
raise msg
|
45
|
+
end
|
46
|
+
expect do
|
47
|
+
default_config.post.call
|
48
|
+
end.to raise_error msg
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
34
53
|
describe '#normalize_security_groups' do
|
35
54
|
before do
|
36
55
|
default_config.security_groups %w(group2 group1 group3)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rivet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Bianco
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-v1
|
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
version: 1.3.6
|
169
169
|
requirements: []
|
170
170
|
rubyforge_project:
|
171
|
-
rubygems_version: 2.4.
|
171
|
+
rubygems_version: 2.4.8
|
172
172
|
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: A tool for managing autoscaling groups and launching ec2 servers
|