lono 8.0.0.pre.rc1 → 8.0.0.pre.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.cody/acceptance/bin/build.sh +5 -5
  3. data/CHANGELOG.md +11 -0
  4. data/README.md +2 -7
  5. data/lib/lono/app.rb +3 -0
  6. data/lib/lono/app_file/build.rb +1 -1
  7. data/lib/lono/builder/context/generic.rb +11 -0
  8. data/lib/lono/builder/context/{loader → loaders}/load_files.rb +1 -1
  9. data/lib/lono/builder/context/{loader.rb → loaders.rb} +2 -2
  10. data/lib/lono/builder/context/params.rb +2 -3
  11. data/lib/lono/builder/context/template.rb +4 -0
  12. data/lib/lono/builder/dsl/evaluator.rb +94 -0
  13. data/lib/lono/builder/{template/configset_injector.rb → dsl/finalizer/configsets.rb} +11 -22
  14. data/lib/lono/builder/{template/dsl → dsl}/finalizer/parameter_groups.rb +2 -2
  15. data/lib/lono/builder/{template/dsl → dsl}/finalizer.rb +2 -1
  16. data/lib/lono/builder/{template/dsl/evaluator/helpers/ec2_helper.rb → dsl/helpers/ec2.rb} +3 -3
  17. data/lib/lono/builder/{template/helpers.rb → dsl/helpers/partials.rb} +2 -6
  18. data/lib/lono/builder/{template/dsl/evaluator/helpers/s3_helper.rb → dsl/helpers/s3.rb} +2 -2
  19. data/lib/lono/builder/{context/ssm_fetcher.rb → dsl/helpers/ssm/fetcher.rb} +2 -2
  20. data/lib/lono/builder/{context/helpers.rb → dsl/helpers/ssm.rb} +3 -3
  21. data/lib/lono/builder/{template/dsl/evaluator/helpers/stack_helper.rb → dsl/helpers/stack.rb} +5 -3
  22. data/lib/lono/builder/{template/dsl/evaluator/helpers/tags_helper.rb → dsl/helpers/tags.rb} +2 -2
  23. data/lib/lono/builder/dsl/helpers/template_file.rb +54 -0
  24. data/lib/lono/builder/{template/dsl/evaluator → dsl}/helpers.rb +3 -4
  25. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/base.rb +4 -5
  26. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/condition.rb +1 -1
  27. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/mapping.rb +1 -1
  28. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/output.rb +1 -1
  29. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/parameter.rb +1 -1
  30. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/resource/property_mover.rb +1 -1
  31. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/resource.rb +1 -1
  32. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/section.rb +1 -1
  33. data/lib/lono/builder/{template/dsl/evaluator → dsl/syntax/core}/squeezer.rb +1 -1
  34. data/lib/lono/builder/{template/dsl/evaluator/section/methods.rb → dsl/syntax/core.rb} +2 -2
  35. data/lib/lono/builder/{template/dsl/evaluator → dsl/syntax}/fn.rb +1 -1
  36. data/lib/lono/builder/{template/dsl/evaluator → dsl}/syntax/parameter_group.rb +1 -1
  37. data/lib/lono/builder/dsl/syntax.rb +9 -0
  38. data/lib/lono/builder/{template/dsl.rb → dsl.rb} +1 -1
  39. data/lib/lono/builder/{template/dsl/evaluator → util}/stringify.rb +1 -1
  40. data/lib/lono/bundler/component/props/extension.rb +0 -1
  41. data/lib/lono/bundler/extract/tar.rb +0 -1
  42. data/lib/lono/cfn/deploy/iam.rb +0 -1
  43. data/lib/lono/cfn/plan/diff/file.rb +2 -1
  44. data/lib/lono/cli/abstract.rb +1 -1
  45. data/lib/lono/cli/build.rb +1 -11
  46. data/lib/lono/cli/help/cfn/status.md +0 -1
  47. data/lib/lono/cli/help/seed.md +22 -21
  48. data/lib/lono/cli/s3.rb +3 -3
  49. data/lib/lono/cli.rb +1 -0
  50. data/lib/lono/importer/service/coder.rb +67 -63
  51. data/lib/lono/logger.rb +1 -0
  52. data/lib/lono/s3/bucket.rb +26 -26
  53. data/lib/lono/s3/rollback.rb +8 -0
  54. data/lib/lono/seeder.rb +20 -2
  55. data/lib/lono/user_data.rb +1 -1
  56. data/lib/lono/utils/{context.rb → contexts.rb} +4 -4
  57. data/lib/lono/version.rb +1 -1
  58. metadata +36 -40
  59. data/lib/lono/builder/context.rb +0 -25
  60. data/lib/lono/builder/template/dsl/evaluator/helpers/core_helper.rb +0 -14
  61. data/lib/lono/builder/template/dsl/evaluator/helpers/file_helper.rb +0 -44
  62. data/lib/lono/builder/template/dsl/evaluator/syntax/extend_with.rb +0 -9
  63. data/lib/lono/builder/template/dsl/evaluator/syntax.rb +0 -11
  64. data/lib/lono/builder/template/dsl/evaluator.rb +0 -45
  65. data/lib/lono/builder/template/evaluate.rb +0 -52
  66. data/lib/lono/extensions/dsl.rb +0 -8
  67. data/lib/lono/extensions/loader.rb +0 -19
  68. data/lib/lono/extensions.rb +0 -18
@@ -16,4 +16,3 @@ class Lono::Bundler::Component::Props
16
16
  end
17
17
  end
18
18
  end
19
-
@@ -31,4 +31,3 @@ class Lono::Bundler::Extract
31
31
  end
32
32
  end
33
33
  end
34
-
@@ -46,4 +46,3 @@ class Lono::Cfn::Deploy
46
46
  end
47
47
  end
48
48
  end
49
-
@@ -10,7 +10,8 @@ module Lono::Cfn::Plan::Diff
10
10
 
11
11
  def summary(existing_path, new_path)
12
12
  command = "diff #{existing_path} #{new_path} -u -s"
13
- pretty_command = "diff #{pretty_path(existing_path)} #{pretty_path(new_path)}"
13
+ # actually use diff but show colordiff in pretty_command
14
+ pretty_command = "#{diff_viewer} #{pretty_path(existing_path)} #{pretty_path(new_path)}"
14
15
  logger.info "=> #{pretty_command}"
15
16
  out = `#{command}`
16
17
  lines = out.split("\n")
@@ -1,7 +1,7 @@
1
1
  class Lono::CLI
2
2
  class Abstract
3
3
  extend Memoist
4
- include Lono::Utils::Context
4
+ include Lono::Utils::Contexts
5
5
  include Lono::Utils::Logging
6
6
  include Lono::Utils::Pretty
7
7
 
@@ -6,7 +6,7 @@ class Lono::CLI
6
6
  def all
7
7
  ensure_s3_bucket_exist unless build_only?
8
8
  pre_build
9
- build_template # build with some placeholders for build_files IE: file://app/files/my.rb
9
+ template_builder.run # build with some placeholders for build_files IE: file://app/files/my.rb
10
10
  post_build
11
11
  upload unless build_only?
12
12
 
@@ -49,16 +49,6 @@ class Lono::CLI
49
49
  Lono::Configset::S3File::Build.new(@options).run # copies files to the output folder
50
50
  end
51
51
 
52
- def build_template
53
- template_builder.run
54
- inject_configsets
55
- end
56
-
57
- def inject_configsets
58
- # The inject_configsets reads it back from disk. Leaving as-is instead of reading all in memory in case there's a reason.
59
- # TODO Lono::Builder::Template::ConfigsetInjector.new(@options).run
60
- end
61
-
62
52
  def post_process_template
63
53
  # support for file://app/files/lambda_layer replacement
64
54
  # TODO: Lono::Builder::Template::PostProcessor.new(@options).run
@@ -12,4 +12,3 @@ Shows the status of the stack. If the stack is in progress then tail the status
12
12
  11:52:33PM UPDATE_COMPLETE AWS::CloudWatch::Alarm HighCpu
13
13
  11:52:35PM UPDATE_COMPLETE_CLEANUP_IN_PROGRESS AWS::CloudFormation::Stack ecs-asg
14
14
  11:52:36PM UPDATE_COMPLETE AWS::CloudFormation::Stack ecs-asg
15
-
@@ -1,23 +1,24 @@
1
1
  ## Example
2
2
 
3
- $ lono seed ecs-asg
4
- Creating starter config files for ecs-asg
5
- create config/ecs-asg/params/development.txt
6
- $ cat config/ecs-asg/params/development.txt
7
- # Required parameters:
8
- VpcId=vpc-111 # Find at vpc CloudFormation Outputs
9
- Subnets=subnet-111,subnet-222,subnet-333 # Find at vpc CloudFormation Outputs
10
- # Optional parameters:
11
- # InstanceType=m5.large
12
- # KeyName=...
13
- # SshLocation=...
14
- # EcsCluster=development
15
- # TagName=ecs-asg-development
16
- # ExistingIamInstanceProfile=...
17
- # ExistingSecurityGroups=...
18
- # EbsVolumeSize=50
19
- # MinSize=1
20
- # MaxSize=4
21
- # MinInstancesInService=2
22
- # MaxBatchSize=1
23
- $
3
+ $ lono seed demo
4
+ Creating starter config files for ec2
5
+ create config/blueprints/ec2/params/dev.txt
6
+ create config/blueprints/ec2/vars/dev.rb
7
+
8
+ To create the files in the top-level app folder
9
+
10
+ $ lono seed ec2 --where app
11
+ Creating starter config files for ec2
12
+ create app/blueprints/ec2/config/params/dev.txt
13
+ create app/blueprints/ec2/config/vars/dev.rb
14
+ $
15
+
16
+ You can also set the default where option with
17
+
18
+ config/app.rb
19
+
20
+ ```ruby
21
+ Lono.configure do |config|
22
+ config.seed.where = "app"
23
+ end
24
+ ```
data/lib/lono/cli/s3.rb CHANGED
@@ -5,21 +5,21 @@ class Lono::CLI
5
5
  desc "deploy", "deploys lono managed s3 bucket"
6
6
  long_desc Help.text("s3/deploy")
7
7
  def deploy
8
- Lono::Bucket.new(options).deploy
8
+ Lono::S3::Bucket.new(options).deploy
9
9
  end
10
10
 
11
11
  desc "show", "shows lono managed s3 bucket"
12
12
  long_desc Help.text("s3/show")
13
13
  opts.yes
14
14
  def show
15
- Lono::Bucket.new(options).show
15
+ Lono::S3::Bucket.new(options).show
16
16
  end
17
17
 
18
18
  desc "delete", "deletes lono managed s3 bucket"
19
19
  long_desc Help.text("s3/delete")
20
20
  opts.yes
21
21
  def delete
22
- Lono::Bucket.new(options).delete
22
+ Lono::S3::Bucket.new(options).delete
23
23
  end
24
24
  end
25
25
  end
data/lib/lono/cli.rb CHANGED
@@ -57,6 +57,7 @@ module Lono
57
57
  long_desc Help.text("seed")
58
58
  option :param, desc: "override convention and specify the param file to use"
59
59
  opts.runtime_options
60
+ option :where, desc: "Where to create file, you specify the top-level folder. Possible values: app, config, vendor. Defaults to config"
60
61
  def seed(blueprint)
61
62
  Seed.new(options.merge(blueprint: blueprint)).create
62
63
  end
@@ -2,80 +2,84 @@ require 'base64'
2
2
  require 'json'
3
3
  require 'net/http'
4
4
 
5
- class Lono::Importer::Service::Coder
6
- def initialize(template, options={})
7
- @template, @options = template, options
8
- end
9
-
10
- def translate
11
- url = "#{Lono::API}/code"
12
- http = net_http_client(url)
13
- req = net_http_request(url,
14
- template: Base64.encode64(@template), # Base64 JSON for special chars that Rack::LintWrapper cannot process
15
- lono_version: Lono::VERSION,
16
- lono_command: lono_command,
17
- )
18
- res = http.request(req) # send request
5
+ module Lono::Importer::Service
6
+ class Coder
7
+ include Lono::Utils::Logging
19
8
 
20
- if res.code == "200"
21
- data = JSON.load(res.body)
22
- ruby_code = print(data) # returns data["ruby_code"] / passthrough
23
- ruby_code
24
- else
25
- logger.info "Error: Unable to convert template to Ruby code."
26
- logger.info "The error has been reported."
27
- logger.info "Non-successful http response status code: #{res.code}"
28
- # logger.info "headers: #{res.each_header.to_h.inspect}"
29
- exit 1
9
+ def initialize(template, options={})
10
+ @template, @options = template, options
30
11
  end
31
- end
32
12
 
33
- private
34
- def print(data)
35
- return if ENV['LONO_PRO_TEST']
13
+ def translate
14
+ url = "#{Lono::API}/code"
15
+ http = net_http_client(url)
16
+ req = net_http_request(url,
17
+ template: Base64.encode64(@template), # Base64 JSON for special chars that Rack::LintWrapper cannot process
18
+ lono_version: Lono::VERSION,
19
+ lono_command: lono_command,
20
+ )
21
+ res = http.request(req) # send request
36
22
 
37
- if data["error"]
38
- # Code was processed but there was this error with an HTTP 200 OK
39
- $stderr.logger.info "ERROR: #{data["error"]}".color(:red)
40
- if data["message"]
41
- $stderr.logger.info data["message"]
23
+ if res.code == "200"
24
+ data = JSON.load(res.body)
25
+ ruby_code = print(data) # returns data["ruby_code"] / passthrough
26
+ ruby_code
27
+ else
28
+ logger.info "Error: Unable to convert template to Ruby code."
29
+ logger.info "The error has been reported."
30
+ logger.info "Non-successful http response status code: #{res.code}"
31
+ # logger.info "headers: #{res.each_header.to_h.inspect}"
32
+ exit 1
42
33
  end
43
- return
44
34
  end
45
35
 
46
- validity = data["valid_ruby"] ? "valid" : "invalid"
47
- if validity == "valid"
48
- $stderr.logger.info "INFO: The generated Ruby code is has #{validity} syntax."
49
- else
50
- $stderr.logger.info "WARN: The generated Ruby code is has #{validity} syntax. Providing because it may be small errors.".color(:yellow) # note redirection disables color
51
- end
36
+ private
37
+ def print(data)
38
+ return if ENV['LONO_PRO_TEST']
52
39
 
53
- $stderr.logger.info <<~EOL
54
- Translated ruby code below:
40
+ if data["error"]
41
+ # Code was processed but there was this error with an HTTP 200 OK
42
+ logger.info "ERROR: #{data["error"]}".color(:red)
43
+ if data["message"]
44
+ logger.info data["message"]
45
+ end
46
+ return
47
+ end
55
48
 
56
- EOL
57
- ruby_code = data["ruby_code"]
58
- logger.info ruby_code
59
- ruby_code
60
- end
49
+ validity = data["valid_ruby"] ? "valid" : "invalid"
50
+ if validity == "valid"
51
+ logger.info "INFO: The generated Ruby code is has #{validity} syntax."
52
+ else
53
+ logger.info "WARN: The generated Ruby code is has #{validity} syntax. Providing because it may be small errors.".color(:yellow) # note redirection disables color
54
+ end
61
55
 
62
- def net_http_client(url)
63
- uri = URI(url)
64
- http = Net::HTTP.new(uri.host, uri.port)
65
- http.open_timeout = http.read_timeout = 30
66
- http.use_ssl = true if uri.scheme == 'https'
67
- http
68
- end
56
+ logger.info <<~EOL
57
+ Translated ruby code below:
69
58
 
70
- def net_http_request(url, data)
71
- req = Net::HTTP::Post.new(url) # url includes query string and uri.path does not, must used url
72
- text = JSON.dump(data)
73
- req.body = text
74
- req.content_length = text.bytesize
75
- req
76
- end
59
+ EOL
60
+ ruby_code = data["ruby_code"]
61
+ logger.info ruby_code
62
+ ruby_code
63
+ end
64
+
65
+ def net_http_client(url)
66
+ uri = URI(url)
67
+ http = Net::HTTP.new(uri.host, uri.port)
68
+ http.open_timeout = http.read_timeout = 30
69
+ http.use_ssl = true if uri.scheme == 'https'
70
+ http
71
+ end
72
+
73
+ def net_http_request(url, data)
74
+ req = Net::HTTP::Post.new(url) # url includes query string and uri.path does not, must used url
75
+ text = JSON.dump(data)
76
+ req.body = text
77
+ req.content_length = text.bytesize
78
+ req
79
+ end
77
80
 
78
- def lono_command
79
- "#{$0} #{ARGV.join(' ')}"
81
+ def lono_command
82
+ "#{$0} #{ARGV.join(' ')}"
83
+ end
80
84
  end
81
85
  end
data/lib/lono/logger.rb CHANGED
@@ -29,5 +29,6 @@ module Lono
29
29
  end
30
30
 
31
31
  public :print
32
+ public :printf
32
33
  end
33
34
  end
@@ -1,41 +1,23 @@
1
1
  module Lono::S3
2
2
  class Bucket
3
- STACK_NAME = ENV['LONO_STACK_NAME'] || "lono"
4
3
  include Lono::AwsServices
4
+ include Lono::Cfn::Concerns
5
5
  include Lono::Utils::Logging
6
6
  extend Lono::AwsServices
7
7
  extend Memoist
8
8
 
9
- class << self
10
- @@name = nil
11
- def name
12
- return @@name if @@name # only memoize once bucket has been created
13
-
14
- check_aws_setup!
15
-
16
- stack = new.find_stack
17
- return unless stack
18
-
19
- stack_resources = find_stack_resources(STACK_NAME)
20
- bucket = stack_resources.find { |r| r.logical_resource_id == "Bucket" }
21
- @@name = bucket.physical_resource_id # actual bucket name
22
- end
23
-
24
- def check_aws_setup!
25
- AwsSetup.new.check!
26
- end
27
- end
28
-
9
+ STACK_NAME = ENV['LONO_STACK_NAME'] || "lono"
29
10
  def initialize(options={})
30
11
  @options = options
31
12
  end
32
13
 
33
14
  def deploy
15
+ stack = find_stack
34
16
  if rollback.complete?
35
17
  logger.info "Existing '#{STACK_NAME}' stack in ROLLBACK_COMPLETE state. Deleting stack before continuing."
18
+ disable_termination_protection
36
19
  cfn.delete_stack(stack_name: STACK_NAME)
37
20
  status.wait
38
- status.reset
39
21
  stack = nil
40
22
  end
41
23
 
@@ -71,7 +53,6 @@ module Lono::S3
71
53
  enable_termination_protection: true,
72
54
  )
73
55
  success = status.wait
74
- status.reset
75
56
  unless success
76
57
  logger.info "ERROR: Unable to create lono stack with managed s3 bucket".color(:red)
77
58
  exit 1
@@ -89,12 +70,12 @@ module Lono::S3
89
70
  are_you_sure?
90
71
 
91
72
  logger.info "Deleting #{STACK_NAME} stack with the s3 bucket"
92
- disable_termination_protect
73
+ disable_termination_protection
93
74
  empty_bucket!
94
75
  cfn.delete_stack(stack_name: STACK_NAME)
95
76
  end
96
77
 
97
- def disable_termination_protect
78
+ def disable_termination_protection
98
79
  cfn.update_termination_protection(
99
80
  stack_name: STACK_NAME,
100
81
  enable_termination_protection: false,
@@ -111,7 +92,6 @@ module Lono::S3
111
92
  def status
112
93
  CfnStatus.new(STACK_NAME)
113
94
  end
114
- memoize :status
115
95
 
116
96
  private
117
97
 
@@ -167,5 +147,25 @@ module Lono::S3
167
147
  Value: lono
168
148
  YAML
169
149
  end
150
+
151
+ def rollback
152
+ Rollback.new(STACK_NAME)
153
+ end
154
+
155
+ class << self
156
+ @@name = nil
157
+ def name
158
+ return @@name if @@name # only memoize once bucket has been created
159
+
160
+ AwsSetup.new.check!
161
+
162
+ stack = new.find_stack
163
+ return unless stack
164
+
165
+ stack_resources = find_stack_resources(STACK_NAME)
166
+ bucket = stack_resources.find { |r| r.logical_resource_id == "Bucket" }
167
+ @@name = bucket.physical_resource_id # actual bucket name
168
+ end
169
+ end
170
170
  end
171
171
  end
@@ -0,0 +1,8 @@
1
+ module Lono::S3
2
+ class Rollback < Lono::Cfn::Deploy::Rollback
3
+ # override initialize
4
+ def initialize(stack)
5
+ @stack = stack
6
+ end
7
+ end
8
+ end
data/lib/lono/seeder.rb CHANGED
@@ -59,7 +59,7 @@ module Lono
59
59
  end
60
60
 
61
61
  content = lines.join("\n")
62
- dest_path = "config/blueprints/#{@blueprint.name}/params/#{Lono.env}.txt" # only support environment level parameters for now
62
+ dest_path = "#{dest_folder}/params/#{Lono.env}.txt" # only support environment level parameters for now
63
63
  create_file(dest_path, content) # Thor::Action
64
64
  end
65
65
 
@@ -89,10 +89,28 @@ module Lono
89
89
 
90
90
  def create_variables
91
91
  src = "#{@blueprint.root}/seed/vars"
92
- dest = "#{Lono.root}/config/blueprints/#{@blueprint.name}/vars"
92
+ dest = "#{dest_folder}/vars"
93
93
  directory(src, dest) if File.exist?(src)
94
94
  end
95
95
 
96
+ # config structure:
97
+ #
98
+ # config/blueprints/demo
99
+ #
100
+ # general structure:
101
+ #
102
+ # app/blueprints/demo/config
103
+ # vendor/blueprints/demo/config
104
+ #
105
+ def dest_folder
106
+ where = @options[:where] || Lono.config.seed.where
107
+ if where == "config"
108
+ "#{Lono.root}/config/blueprints/#{@blueprint.name}"
109
+ else # app or vendor
110
+ "#{Lono.root}/#{where}/blueprints/#{@blueprint.name}/config"
111
+ end
112
+ end
113
+
96
114
  private
97
115
  def env
98
116
  Lono.env # allows for seed/vars/%env%.rb.tt
@@ -16,7 +16,7 @@ module Lono
16
16
  pretty_path = pretty_path(@path)
17
17
  logger.info "Building user_data for '#{@name}' at #{pretty_path}"
18
18
  if File.exist?(@path)
19
- logger.info RenderMePretty.result(@path, context: context)
19
+ logger.info RenderMePretty.result(@path, context: template_context)
20
20
  else
21
21
  logger.info "ERROR: #{pretty_path} does not exist".color(:red)
22
22
  exit 1
@@ -1,11 +1,11 @@
1
1
  module Lono::Utils
2
- module Context
2
+ module Contexts
3
3
  extend Memoist
4
4
 
5
- def context
6
- Lono::Builder::Context.new(@options)
5
+ def template_context
6
+ Lono::Builder::Context::Template.new(@options)
7
7
  end
8
- memoize :context
8
+ memoize :template_context
9
9
 
10
10
  def params_context
11
11
  Lono::Builder::Context::Params.new(@options)
data/lib/lono/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "8.0.0-rc1"
2
+ VERSION = "8.0.0-rc2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lono
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.0.pre.rc1
4
+ version: 8.0.0.pre.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-21 00:00:00.000000000 Z
11
+ date: 2022-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -515,48 +515,46 @@ files:
515
515
  - lib/lono/aws_services/helper.rb
516
516
  - lib/lono/blueprint.rb
517
517
  - lib/lono/booter.rb
518
- - lib/lono/builder/context.rb
519
- - lib/lono/builder/context/helpers.rb
520
- - lib/lono/builder/context/loader.rb
521
- - lib/lono/builder/context/loader/load_files.rb
518
+ - lib/lono/builder/context/generic.rb
519
+ - lib/lono/builder/context/loaders.rb
520
+ - lib/lono/builder/context/loaders/load_files.rb
522
521
  - lib/lono/builder/context/params.rb
523
- - lib/lono/builder/context/ssm_fetcher.rb
522
+ - lib/lono/builder/context/template.rb
523
+ - lib/lono/builder/dsl.rb
524
+ - lib/lono/builder/dsl/evaluator.rb
525
+ - lib/lono/builder/dsl/finalizer.rb
526
+ - lib/lono/builder/dsl/finalizer/configsets.rb
527
+ - lib/lono/builder/dsl/finalizer/parameter_groups.rb
528
+ - lib/lono/builder/dsl/helpers.rb
529
+ - lib/lono/builder/dsl/helpers/ec2.rb
530
+ - lib/lono/builder/dsl/helpers/partials.rb
531
+ - lib/lono/builder/dsl/helpers/s3.rb
532
+ - lib/lono/builder/dsl/helpers/ssm.rb
533
+ - lib/lono/builder/dsl/helpers/ssm/fetcher.rb
534
+ - lib/lono/builder/dsl/helpers/stack.rb
535
+ - lib/lono/builder/dsl/helpers/tags.rb
536
+ - lib/lono/builder/dsl/helpers/template_file.rb
537
+ - lib/lono/builder/dsl/syntax.rb
538
+ - lib/lono/builder/dsl/syntax/core.rb
539
+ - lib/lono/builder/dsl/syntax/core/base.rb
540
+ - lib/lono/builder/dsl/syntax/core/condition.rb
541
+ - lib/lono/builder/dsl/syntax/core/mapping.rb
542
+ - lib/lono/builder/dsl/syntax/core/output.rb
543
+ - lib/lono/builder/dsl/syntax/core/parameter.rb
544
+ - lib/lono/builder/dsl/syntax/core/resource.rb
545
+ - lib/lono/builder/dsl/syntax/core/resource/property_mover.rb
546
+ - lib/lono/builder/dsl/syntax/core/section.rb
547
+ - lib/lono/builder/dsl/syntax/core/squeezer.rb
548
+ - lib/lono/builder/dsl/syntax/fn.rb
549
+ - lib/lono/builder/dsl/syntax/parameter_group.rb
524
550
  - lib/lono/builder/param.rb
525
551
  - lib/lono/builder/template.rb
526
552
  - lib/lono/builder/template/aws_service.rb
527
553
  - lib/lono/builder/template/bashify.rb
528
- - lib/lono/builder/template/configset_injector.rb
529
- - lib/lono/builder/template/dsl.rb
530
- - lib/lono/builder/template/dsl/evaluator.rb
531
- - lib/lono/builder/template/dsl/evaluator/fn.rb
532
- - lib/lono/builder/template/dsl/evaluator/helpers.rb
533
- - lib/lono/builder/template/dsl/evaluator/helpers/core_helper.rb
534
- - lib/lono/builder/template/dsl/evaluator/helpers/ec2_helper.rb
535
- - lib/lono/builder/template/dsl/evaluator/helpers/file_helper.rb
536
- - lib/lono/builder/template/dsl/evaluator/helpers/s3_helper.rb
537
- - lib/lono/builder/template/dsl/evaluator/helpers/stack_helper.rb
538
- - lib/lono/builder/template/dsl/evaluator/helpers/tags_helper.rb
539
- - lib/lono/builder/template/dsl/evaluator/section/base.rb
540
- - lib/lono/builder/template/dsl/evaluator/section/condition.rb
541
- - lib/lono/builder/template/dsl/evaluator/section/mapping.rb
542
- - lib/lono/builder/template/dsl/evaluator/section/methods.rb
543
- - lib/lono/builder/template/dsl/evaluator/section/output.rb
544
- - lib/lono/builder/template/dsl/evaluator/section/parameter.rb
545
- - lib/lono/builder/template/dsl/evaluator/section/resource.rb
546
- - lib/lono/builder/template/dsl/evaluator/section/resource/property_mover.rb
547
- - lib/lono/builder/template/dsl/evaluator/section/section.rb
548
- - lib/lono/builder/template/dsl/evaluator/squeezer.rb
549
- - lib/lono/builder/template/dsl/evaluator/stringify.rb
550
- - lib/lono/builder/template/dsl/evaluator/syntax.rb
551
- - lib/lono/builder/template/dsl/evaluator/syntax/extend_with.rb
552
- - lib/lono/builder/template/dsl/evaluator/syntax/parameter_group.rb
553
- - lib/lono/builder/template/dsl/finalizer.rb
554
- - lib/lono/builder/template/dsl/finalizer/parameter_groups.rb
555
- - lib/lono/builder/template/evaluate.rb
556
- - lib/lono/builder/template/helpers.rb
557
554
  - lib/lono/builder/template/output.rb
558
555
  - lib/lono/builder/template/post_processor.rb
559
556
  - lib/lono/builder/template/upload.rb
557
+ - lib/lono/builder/util/stringify.rb
560
558
  - lib/lono/bundler.rb
561
559
  - lib/lono/bundler/cli.rb
562
560
  - lib/lono/bundler/cli/base.rb
@@ -718,9 +716,6 @@ files:
718
716
  - lib/lono/configset/strategy/helpers/dsl/syntax.rb
719
717
  - lib/lono/configset/strategy/helpers/erb.rb
720
718
  - lib/lono/core.rb
721
- - lib/lono/extensions.rb
722
- - lib/lono/extensions/dsl.rb
723
- - lib/lono/extensions/loader.rb
724
719
  - lib/lono/importer.rb
725
720
  - lib/lono/importer/base.rb
726
721
  - lib/lono/importer/converter.rb
@@ -743,6 +738,7 @@ files:
743
738
  - lib/lono/registration.rb
744
739
  - lib/lono/s3/aws_setup.rb
745
740
  - lib/lono/s3/bucket.rb
741
+ - lib/lono/s3/rollback.rb
746
742
  - lib/lono/s3/uploader.rb
747
743
  - lib/lono/script/base.rb
748
744
  - lib/lono/script/build.rb
@@ -750,7 +746,7 @@ files:
750
746
  - lib/lono/seeder.rb
751
747
  - lib/lono/seeder/service_role.rb
752
748
  - lib/lono/user_data.rb
753
- - lib/lono/utils/context.rb
749
+ - lib/lono/utils/contexts.rb
754
750
  - lib/lono/utils/item/file_methods.rb
755
751
  - lib/lono/utils/item/zip.rb
756
752
  - lib/lono/utils/logging.rb
@@ -1,25 +0,0 @@
1
- # Encapsulates helper methods and instance variables to be rendered in the ERB templates.
2
- module Lono::Builder
3
- class Context < Lono::CLI::Base
4
- extend Memoist
5
- include Lono::Builder::Template::Helpers
6
- include Loader
7
- include Helpers # ERB
8
- include Template::Dsl::Evaluator::Syntax # DSL
9
- include Lono::Utils::Context
10
-
11
- # Take a hash and makes them instance variables in the current scope.
12
- # Use this in custom helper methods to make variables accessible to ERB templates.
13
- def instance_variables!(variables)
14
- variables.each do |key, value|
15
- instance_variable_set('@' + key.to_s, value)
16
- end
17
- end
18
-
19
- # For Lono::AppFile::Build usage of Thor::Action directory
20
- # For some reason a send(:binding) doesnt work but get_binding like this works.
21
- def get_binding
22
- binding
23
- end
24
- end
25
- end
@@ -1,14 +0,0 @@
1
- module Lono::Builder::Template::Dsl::Evaluator::Helpers
2
- module CoreHelper
3
- extend Memoist
4
-
5
- def stack_name
6
- @options[:stack]
7
- end
8
-
9
- def setting
10
- Lono::Setting.new
11
- end
12
- memoize :setting
13
- end
14
- end