cfer 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Dockerfile +5 -0
- data/README.md +27 -0
- data/Rakefile +17 -1
- data/lib/cfer.rb +1 -0
- data/lib/cfer/core/resource.rb +1 -1
- data/lib/cfer/core/stack.rb +11 -0
- data/lib/cfer/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2IzNjMyMzZiNTJiZjhkNjU2OGYyZTNmNmZjMDFkYWQzZGRhNTQ1NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MjQ5NGU4Mjc4ODUwZWFlZGM3MTBmNGRlOTY5MjE5NDI3MjQyMmJhMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzE4OWI3YTM2MDdmZjBkZDM3YTM0ODExZjdiOTk2YmQ4YWRjZTU3ODg1MTdm
|
10
|
+
NjBiNDRlM2MwYTJhOTNiMjExNzIxOGNlNzVhNmVkZjI1MGM4YmY4MTA1YzU5
|
11
|
+
ZWQ4MTQ1YTlkZDNhOWQ1ZTQ3MzEwYjY4MTkyNGE4NWVmN2RlNTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmM1Y2M4YWI3MjQ3NzM3OWRkMzMzNzhjNDI1YWM4NzkwNzExYjVlN2FhNDI3
|
14
|
+
NzA1ODdmOGNhYzNhMWM3NTAwNjVjOTQ3OGZhYzQ1OTM3MThmMDFkNGVmNzg0
|
15
|
+
NWFjMGE0MjQzYTU0NzkxMjhiMzQzN2E4OGEzMTJkZjkxYzFiNmM=
|
data/Dockerfile
ADDED
data/README.md
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
|
7
7
|
Cfer is a lightweight toolkit for managing CloudFormation templates.
|
8
8
|
|
9
|
+
Read about Cfer [here](http://tilmonedwards.com/2015/07/28/cfer.html).
|
10
|
+
|
9
11
|
## Installation
|
10
12
|
|
11
13
|
Add this line to your application's Gemfile:
|
@@ -137,6 +139,29 @@ Outputs may be defined using the `output` function:
|
|
137
139
|
output :OutputName, Fn::ref(:ResourceName)
|
138
140
|
```
|
139
141
|
|
142
|
+
#### Including code from multiple files
|
143
|
+
|
144
|
+
Templates can get pretty large, and splitting template code into multiple
|
145
|
+
files can help keep things more manageable. The `include_template`
|
146
|
+
function works in a similar way to ruby's `require_relative`, but
|
147
|
+
within the context of the CloudFormation stack:
|
148
|
+
|
149
|
+
```ruby
|
150
|
+
include_template 'ec2.rb'
|
151
|
+
```
|
152
|
+
|
153
|
+
You can also include multiple files in a single call:
|
154
|
+
|
155
|
+
```ruby
|
156
|
+
include_template(
|
157
|
+
'stack/ec2.rb',
|
158
|
+
'stack/elb.rb'
|
159
|
+
)
|
160
|
+
```
|
161
|
+
|
162
|
+
The path to included files is relative to the base template file
|
163
|
+
(e.g. the `converge` command `-t` option).
|
164
|
+
|
140
165
|
## SDK
|
141
166
|
|
142
167
|
Embedding the Cfer SDK involves interacting with two components: The `Client` and the `Stack`.
|
@@ -212,6 +237,8 @@ This project uses [git-flow](http://nvie.com/posts/a-successful-git-branching-mo
|
|
212
237
|
|
213
238
|
Always use `--no-ff` when merging into `develop` or `master`.
|
214
239
|
|
240
|
+
This project also contains a [Code of Conduct](CODE_OF_CONDUCT.md), which should be followed when submitting feedback or contributions to this project.
|
241
|
+
|
215
242
|
### New features
|
216
243
|
|
217
244
|
* Branch from `develop`
|
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
1
|
+
#require "bundler/gem_tasks"
|
2
2
|
gem 'cfer'
|
3
3
|
require 'cfer'
|
4
4
|
require 'highline'
|
@@ -39,3 +39,19 @@ end
|
|
39
39
|
|
40
40
|
task :converge => [:vpc, :instance]
|
41
41
|
|
42
|
+
|
43
|
+
########################
|
44
|
+
##### END OF DEMO ######
|
45
|
+
########################
|
46
|
+
|
47
|
+
|
48
|
+
# This task isn't really part of Cfer.
|
49
|
+
# It just makes it easier for me to release new versions.
|
50
|
+
task :release do
|
51
|
+
require_relative 'lib/cfer/version.rb'
|
52
|
+
|
53
|
+
`git checkout master`
|
54
|
+
`git merge develop --no-ff -m 'Merge from develop for release v#{Cfer::VERSION}'`
|
55
|
+
`git tag -m "Release v#{Cfer::VERSION}" #{Cfer::VERSION}`
|
56
|
+
end
|
57
|
+
|
data/lib/cfer.rb
CHANGED
@@ -230,6 +230,7 @@ module Cfer
|
|
230
230
|
end
|
231
231
|
end
|
232
232
|
|
233
|
+
Dir["#{File.dirname(__FILE__)}/cfer/*.rb"].each { |f| require(f) }
|
233
234
|
Dir["#{File.dirname(__FILE__)}/cfer/**/*.rb"].each { |f| require(f) }
|
234
235
|
Dir["#{File.dirname(__FILE__)}/cferext/**/*.rb"].each { |f| require(f) }
|
235
236
|
|
data/lib/cfer/core/resource.rb
CHANGED
data/lib/cfer/core/stack.rb
CHANGED
@@ -159,6 +159,17 @@ module Cfer::Core
|
|
159
159
|
to_h.to_json
|
160
160
|
end
|
161
161
|
|
162
|
+
# Includes template code from one or more files, and evals it in the context of this stack.
|
163
|
+
# Filenames are relative to the file containing the invocation of this method.
|
164
|
+
def include_template(*files)
|
165
|
+
calling_file = caller.first.split(/:\d/,2).first
|
166
|
+
dirname = File.dirname(calling_file)
|
167
|
+
files.each do |file|
|
168
|
+
path = File.join(dirname, file)
|
169
|
+
instance_eval(File.read(path), path)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
162
173
|
private
|
163
174
|
def verify_param(param_name, err_msg)
|
164
175
|
raise Cfer::Util::CferError, err_msg if (@parameters[param_name] && !yield(@parameters[param_name].to_s))
|
data/lib/cfer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Edwards
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docile
|
@@ -205,6 +205,7 @@ files:
|
|
205
205
|
- .travis.yml
|
206
206
|
- .yardopts
|
207
207
|
- CODE_OF_CONDUCT.md
|
208
|
+
- Dockerfile
|
208
209
|
- Gemfile
|
209
210
|
- LICENSE.txt
|
210
211
|
- README.md
|