lono 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/lono/dsl.rb +6 -0
- data/lib/lono/version.rb +1 -1
- data/spec/lib/lono_spec.rb +1 -11
- data/spec/project/templates/app.json.erb +1 -28
- data/spec/project/templates/partial/host_record.json.erb +28 -0
- metadata +3 -1
data/lib/lono/dsl.rb
CHANGED
@@ -70,6 +70,12 @@ module Lono
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
def partial(path)
|
74
|
+
path = "#{@options[:project_root]}/templates/partial/#{path}"
|
75
|
+
template = IO.read(path)
|
76
|
+
ERB.new(template).result(binding)
|
77
|
+
end
|
78
|
+
|
73
79
|
def user_data(path)
|
74
80
|
path = "#{@options[:project_root]}/templates/user_data/#{path}"
|
75
81
|
template = IO.read(path)
|
data/lib/lono/version.rb
CHANGED
data/spec/lib/lono_spec.rb
CHANGED
@@ -22,16 +22,6 @@ describe Lono do
|
|
22
22
|
json['Description'].should == "Api Stack"
|
23
23
|
json['Mappings']['AWSRegionArch2AMI']['us-east-1']['64'].should == 'ami-123'
|
24
24
|
end
|
25
|
-
end
|
26
|
-
|
27
|
-
describe Lono::Task do
|
28
|
-
before(:each) do
|
29
|
-
@project_root = File.expand_path("../../project", __FILE__)
|
30
|
-
end
|
31
|
-
|
32
|
-
after(:each) do
|
33
|
-
FileUtils.rm_rf("#{@project_root}/output")
|
34
|
-
end
|
35
25
|
|
36
26
|
it "task should generate cloud formation templates" do
|
37
27
|
Lono::Task.generate(
|
@@ -44,4 +34,4 @@ describe Lono::Task do
|
|
44
34
|
json['Description'].should == "Api Stack"
|
45
35
|
json['Mappings']['AWSRegionArch2AMI']['us-east-1']['64'].should == 'ami-123'
|
46
36
|
end
|
47
|
-
end
|
37
|
+
end
|
@@ -178,34 +178,7 @@
|
|
178
178
|
},
|
179
179
|
"Type": "AWS::CloudWatch::Alarm"
|
180
180
|
},
|
181
|
-
"
|
182
|
-
"Properties": {
|
183
|
-
"Comment": "DNS name for my stack.",
|
184
|
-
"HostedZoneName": "mydomain.net.",
|
185
|
-
"Name": {
|
186
|
-
"Fn::Join": [
|
187
|
-
"",
|
188
|
-
[
|
189
|
-
{
|
190
|
-
"Ref": "AWS::StackName"
|
191
|
-
},
|
192
|
-
".mydomain.net"
|
193
|
-
]
|
194
|
-
]
|
195
|
-
},
|
196
|
-
"ResourceRecords": [
|
197
|
-
{
|
198
|
-
"Fn::GetAtt": [
|
199
|
-
"elb",
|
200
|
-
"DNSName"
|
201
|
-
]
|
202
|
-
}
|
203
|
-
],
|
204
|
-
"TTL": "60",
|
205
|
-
"Type": "CNAME"
|
206
|
-
},
|
207
|
-
"Type": "AWS::Route53::RecordSet"
|
208
|
-
},
|
181
|
+
<%= partial("host_record.json.erb") %>
|
209
182
|
"LaunchConfig": {
|
210
183
|
"Properties": {
|
211
184
|
"BlockDeviceMappings": [
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"HostRecord": {
|
2
|
+
"Properties": {
|
3
|
+
"Comment": "DNS name for my stack.",
|
4
|
+
"HostedZoneName": "mydomain.net.",
|
5
|
+
"Name": {
|
6
|
+
"Fn::Join": [
|
7
|
+
"",
|
8
|
+
[
|
9
|
+
{
|
10
|
+
"Ref": "AWS::StackName"
|
11
|
+
},
|
12
|
+
".mydomain.net"
|
13
|
+
]
|
14
|
+
]
|
15
|
+
},
|
16
|
+
"ResourceRecords": [
|
17
|
+
{
|
18
|
+
"Fn::GetAtt": [
|
19
|
+
"elb",
|
20
|
+
"DNSName"
|
21
|
+
]
|
22
|
+
}
|
23
|
+
],
|
24
|
+
"TTL": "60",
|
25
|
+
"Type": "CNAME"
|
26
|
+
},
|
27
|
+
"Type": "AWS::Route53::RecordSet"
|
28
|
+
},
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lono
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -217,6 +217,7 @@ files:
|
|
217
217
|
- spec/lib/lono_spec.rb
|
218
218
|
- spec/project/config/lono.rb
|
219
219
|
- spec/project/templates/app.json.erb
|
220
|
+
- spec/project/templates/partial/host_record.json.erb
|
220
221
|
- spec/project/templates/user_data/app.sh.erb
|
221
222
|
- spec/spec_helper.rb
|
222
223
|
homepage: http://github.com/tongueroo/lono
|
@@ -248,5 +249,6 @@ test_files:
|
|
248
249
|
- spec/lib/lono_spec.rb
|
249
250
|
- spec/project/config/lono.rb
|
250
251
|
- spec/project/templates/app.json.erb
|
252
|
+
- spec/project/templates/partial/host_record.json.erb
|
251
253
|
- spec/project/templates/user_data/app.sh.erb
|
252
254
|
- spec/spec_helper.rb
|