lono 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,10 +1,8 @@
1
- Lono
2
- ===========
1
+ # Lono
3
2
 
4
3
  Lono is a Cloud Formation Template ruby generator. Lono generates Cloud Formation templates based on ERB templates.
5
4
 
6
- Usage
7
- ------------
5
+ ## Usage
8
6
 
9
7
  <pre>
10
8
  $ gem install lono
@@ -70,4 +68,25 @@ The example ERB template file is in templates/app.json.erb.
70
68
  $ guard
71
69
  </pre>
72
70
 
73
- The lono init comamnd also sets up guard-lono and guard-cloudformation. Guard-lono continuously generates the cloud formation templates and guard-cloudformation continuously verifies that the cloud formation templates are valid via AWS's cfn-validate-template command.
71
+ The lono init comamnd also sets up guard-lono and guard-cloudformation. Guard-lono continuously generates the cloud formation templates and guard-cloudformation continuously verifies that the cloud formation templates are valid via AWS's cfn-validate-template command.
72
+
73
+ ## User Data Helper
74
+
75
+ In the template files, there's user_data helper method available which can be used to include a user data script. The user data script should be in in the templates/user_data folder of the project. So:
76
+
77
+ * user_data('bootstrap.sh.erb') -> templates/user_data/bootstrap.sh.erb
78
+ * user_data('db.sh.erb') -> templates/user_data/db.sh.erb
79
+
80
+ Here's how you would call it in the template.
81
+
82
+ ```json
83
+ "UserData": {
84
+ "Fn::Base64": {
85
+ "Fn::Join": [
86
+ "",
87
+ [
88
+ <%= user_data('bootstrap.sh.erb') %>
89
+ ]
90
+ ]
91
+ }
92
+ ```
data/lib/lono/dsl.rb CHANGED
@@ -70,7 +70,7 @@ module Lono
70
70
  end
71
71
 
72
72
  def user_data(path)
73
- path = "#{@options[:project_root]}/config/lono/#{path}"
73
+ path = "#{@options[:project_root]}/templates/user_data/#{path}"
74
74
  template = IO.read(path)
75
75
  ERB.new(template).result(binding).split("\n").to_json
76
76
  end
data/lib/lono/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -261,7 +261,7 @@
261
261
  "Fn::Join": [
262
262
  "",
263
263
  [
264
- <%= user_data("bootstrap_app.sh") %>
264
+ <%= user_data("app.sh.erb") %>
265
265
  ]
266
266
  ]
267
267
  }
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.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -214,8 +214,8 @@ files:
214
214
  - lono.gemspec
215
215
  - spec/lib/lono_spec.rb
216
216
  - spec/project/config/lono.rb
217
- - spec/project/config/lono/bootstrap_app.sh
218
217
  - spec/project/templates/app.json.erb
218
+ - spec/project/templates/user_data/app.sh.erb
219
219
  - spec/spec_helper.rb
220
220
  homepage: ''
221
221
  licenses: []
@@ -245,6 +245,6 @@ summary: Lono is a Cloud Formation Template ruby generator. Lono generates Clou
245
245
  test_files:
246
246
  - spec/lib/lono_spec.rb
247
247
  - spec/project/config/lono.rb
248
- - spec/project/config/lono/bootstrap_app.sh
249
248
  - spec/project/templates/app.json.erb
249
+ - spec/project/templates/user_data/app.sh.erb
250
250
  - spec/spec_helper.rb