lono 8.0.0.pre.rc1 → 8.0.0.pre.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. checksums.yaml +4 -4
  2. data/.cody/acceptance/bin/build.sh +5 -5
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +84 -0
  4. data/.github/ISSUE_TEMPLATE/documentation.md +12 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +64 -0
  6. data/.github/ISSUE_TEMPLATE/question.md +14 -0
  7. data/.github/ISSUE_TEMPLATE.md +7 -0
  8. data/.github/PULL_REQUEST_TEMPLATE.md +50 -0
  9. data/CHANGELOG.md +59 -2
  10. data/Gemfile +1 -3
  11. data/README.md +2 -7
  12. data/lib/lono/app/callable_option/concern.rb +12 -0
  13. data/lib/lono/app/callable_option.rb +56 -0
  14. data/lib/lono/app.rb +56 -20
  15. data/lib/lono/autoloader.rb +1 -0
  16. data/lib/lono/aws_services/helper.rb +0 -2
  17. data/lib/lono/blueprint.rb +1 -18
  18. data/lib/lono/builder/allow/base.rb +54 -0
  19. data/lib/lono/builder/allow/env.rb +17 -0
  20. data/lib/lono/builder/allow/region.rb +20 -0
  21. data/lib/lono/builder/allow.rb +8 -0
  22. data/lib/lono/builder/configset/combiner.rb +145 -0
  23. data/lib/lono/builder/configset/definition/base.rb +47 -0
  24. data/lib/lono/builder/configset/definition/context.rb +70 -0
  25. data/lib/lono/{configset/strategy/helpers/dsl → builder/configset/definition/dsl/syntax}/auth.rb +1 -1
  26. data/lib/lono/builder/configset/definition/dsl/syntax/content.rb +22 -0
  27. data/lib/lono/{configset/strategy/helpers/dsl/syntax.rb → builder/configset/definition/dsl/syntax/core.rb} +15 -9
  28. data/lib/lono/{configset/strategy/helpers/dsl → builder/configset/definition/dsl/syntax}/package.rb +1 -1
  29. data/lib/lono/builder/configset/definition/dsl/syntax.rb +5 -0
  30. data/lib/lono/{configset/strategy → builder/configset/definition}/dsl.rb +10 -14
  31. data/lib/lono/{configset/strategy → builder/configset/definition}/erb.rb +13 -16
  32. data/lib/lono/builder/configset/definition.rb +18 -0
  33. data/lib/lono/builder/configset/evaluator.rb +10 -0
  34. data/lib/lono/builder/configset/registration.rb +35 -0
  35. data/lib/lono/builder/context.rb +33 -18
  36. data/lib/lono/builder/dsl/evaluator.rb +45 -0
  37. data/lib/lono/builder/dsl/finalizer/base.rb +8 -0
  38. data/lib/lono/builder/dsl/finalizer/configsets.rb +20 -0
  39. data/lib/lono/builder/dsl/finalizer/files/base.rb +4 -0
  40. data/lib/lono/builder/dsl/finalizer/files/build.rb +50 -0
  41. data/lib/lono/builder/dsl/finalizer/files/replace.rb +36 -0
  42. data/lib/lono/builder/dsl/finalizer/files.rb +9 -0
  43. data/lib/lono/builder/{template/dsl → dsl}/finalizer/parameter_groups.rb +6 -5
  44. data/lib/lono/builder/dsl/finalizer.rb +15 -0
  45. data/lib/lono/builder/{template/dsl/evaluator/helpers/ec2_helper.rb → dsl/helpers/ec2.rb} +3 -3
  46. data/lib/lono/builder/dsl/helpers/files.rb +7 -0
  47. data/lib/lono/builder/{template/helpers.rb → dsl/helpers/partials.rb} +48 -57
  48. data/lib/lono/builder/dsl/helpers/s3.rb +14 -0
  49. data/lib/lono/builder/{context/ssm_fetcher.rb → dsl/helpers/ssm/fetcher.rb} +5 -3
  50. data/lib/lono/builder/{context/helpers.rb → dsl/helpers/ssm.rb} +3 -3
  51. data/lib/lono/builder/{template/dsl/evaluator/helpers/stack_helper.rb → dsl/helpers/stack.rb} +6 -6
  52. data/lib/lono/builder/{template/dsl/evaluator/helpers/tags_helper.rb → dsl/helpers/tags.rb} +2 -2
  53. data/lib/lono/builder/dsl/helpers/template_file.rb +66 -0
  54. data/lib/lono/builder/dsl/helpers.rb +5 -0
  55. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/base.rb +4 -5
  56. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/condition.rb +1 -1
  57. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/mapping.rb +1 -1
  58. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/output.rb +1 -1
  59. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/parameter.rb +1 -1
  60. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/resource/property_mover.rb +12 -2
  61. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/resource.rb +1 -1
  62. data/lib/lono/builder/{template/dsl/evaluator/section → dsl/syntax/core}/section.rb +1 -1
  63. data/lib/lono/builder/dsl/syntax/core/squeezer.rb +40 -0
  64. data/lib/lono/builder/{template/dsl/evaluator/section/methods.rb → dsl/syntax/core.rb} +2 -2
  65. data/lib/lono/builder/{template/dsl/evaluator → dsl/syntax}/fn.rb +1 -3
  66. data/lib/lono/builder/{template/dsl/evaluator → dsl}/syntax/parameter_group.rb +1 -1
  67. data/lib/lono/builder/dsl/syntax.rb +9 -0
  68. data/lib/lono/builder/{template/dsl.rb → dsl.rb} +2 -2
  69. data/lib/lono/builder/param.rb +5 -2
  70. data/lib/lono/builder/template/upload.rb +2 -15
  71. data/lib/lono/builder/template.rb +1 -3
  72. data/lib/lono/builder/{template/dsl/evaluator → util}/stringify.rb +1 -1
  73. data/lib/lono/builder.rb +39 -0
  74. data/lib/lono/bundler/component/props/extension.rb +0 -1
  75. data/lib/lono/bundler/extract/tar.rb +0 -1
  76. data/lib/lono/bundler/util/git.rb +18 -16
  77. data/lib/lono/cfn/base.rb +2 -2
  78. data/lib/lono/cfn/cancel.rb +5 -5
  79. data/lib/lono/cfn/concerns/build.rb +1 -1
  80. data/lib/lono/cfn/delete.rb +5 -2
  81. data/lib/lono/cfn/deploy/iam.rb +1 -2
  82. data/lib/lono/cfn/deploy/rollback.rb +1 -3
  83. data/lib/lono/cfn/deploy.rb +46 -5
  84. data/lib/lono/cfn/download.rb +0 -1
  85. data/lib/lono/cfn/plan/changeset.rb +3 -3
  86. data/lib/lono/cfn/plan/diff/data.rb +11 -1
  87. data/lib/lono/cfn/plan/diff/file.rb +2 -1
  88. data/lib/lono/cfn/plan/param.rb +1 -1
  89. data/lib/lono/cfn/plan/template.rb +2 -2
  90. data/lib/lono/cfn/plan.rb +1 -0
  91. data/lib/lono/cli/abstract.rb +0 -6
  92. data/lib/lono/cli/base.rb +6 -3
  93. data/lib/lono/cli/clean.rb +3 -2
  94. data/lib/lono/cli/help/cfn/status.md +0 -1
  95. data/lib/lono/cli/help/new/helper.md +27 -0
  96. data/lib/lono/cli/help/new/hook.md +14 -0
  97. data/lib/lono/cli/help/new/project.md +3 -10
  98. data/lib/lono/cli/help/seed.md +22 -21
  99. data/lib/lono/cli/iam.rb +27 -0
  100. data/lib/lono/cli/list.rb +3 -6
  101. data/lib/lono/cli/new/blueprint.rb +3 -9
  102. data/lib/lono/cli/new/configset.rb +11 -44
  103. data/lib/lono/cli/new/helper.rb +19 -11
  104. data/lib/lono/cli/new/hook.rb +32 -0
  105. data/lib/lono/cli/new/sequence.rb +6 -1
  106. data/lib/lono/cli/new.rb +9 -9
  107. data/lib/lono/cli/s3.rb +3 -3
  108. data/lib/lono/cli/script/build.rb +0 -5
  109. data/lib/lono/cli/status.rb +18 -0
  110. data/lib/lono/{inspector → cli}/summary.rb +23 -33
  111. data/lib/lono/cli.rb +16 -16
  112. data/lib/lono/command.rb +28 -2
  113. data/lib/lono/component.rb +29 -0
  114. data/lib/lono/concerns/aws_info.rb +14 -0
  115. data/lib/lono/concerns/names.rb +9 -0
  116. data/lib/lono/configset.rb +17 -0
  117. data/lib/lono/core.rb +11 -1
  118. data/lib/lono/ext/bundler.rb +7 -0
  119. data/lib/lono/ext/core/module.rb +31 -0
  120. data/lib/lono/ext/core/object.rb +32 -0
  121. data/lib/lono/ext/core/string.rb +9 -0
  122. data/lib/lono/ext.rb +4 -0
  123. data/lib/lono/files/base.rb +12 -0
  124. data/lib/lono/{utils → files/builder/lambda_layer}/rsync.rb +3 -5
  125. data/lib/lono/{app_file/build → files/builder}/lambda_layer/ruby_packager.rb +104 -79
  126. data/lib/lono/files/builder/lambda_layer/ruby_version.rb +38 -0
  127. data/lib/lono/files/builder/lambda_layer.rb +17 -0
  128. data/lib/lono/files/builder.rb +37 -0
  129. data/lib/lono/files/compressor.rb +53 -0
  130. data/lib/lono/files/concerns/post_processing.rb +52 -0
  131. data/lib/lono/files/concerns/registration.rb +16 -0
  132. data/lib/lono/files/registry.rb +6 -0
  133. data/lib/lono/files.rb +41 -0
  134. data/lib/lono/hooks/builder.rb +50 -0
  135. data/lib/lono/hooks/concern.rb +9 -0
  136. data/lib/lono/hooks/dsl.rb +20 -0
  137. data/lib/lono/hooks/runner.rb +46 -0
  138. data/lib/lono/layering/layer.rb +64 -56
  139. data/lib/lono/logger.rb +2 -3
  140. data/lib/lono/names.rb +7 -10
  141. data/lib/lono/s3/bucket.rb +43 -37
  142. data/lib/lono/s3/rollback.rb +8 -0
  143. data/lib/lono/s3/uploader.rb +33 -28
  144. data/lib/lono/script/build.rb +0 -5
  145. data/lib/lono/seeder.rb +38 -29
  146. data/lib/lono/user_data.rb +3 -1
  147. data/lib/lono/utils/sh.rb +32 -0
  148. data/lib/lono/utils.rb +5 -0
  149. data/lib/lono/version.rb +1 -1
  150. data/lib/lono/yamler/validator.rb +7 -22
  151. data/lib/lono.rb +8 -0
  152. data/lib/templates/configset/configset.rb +2 -16
  153. data/lib/templates/examples/configset/configset.rb +16 -0
  154. data/lib/templates/helper/%underscore_name%_helper.rb.tt +1 -1
  155. data/lib/templates/hook/config/hooks.rb.tt +14 -0
  156. data/lono.gemspec +1 -1
  157. metadata +99 -93
  158. data/lib/lono/app_file/base.rb +0 -28
  159. data/lib/lono/app_file/build/lambda_layer.rb +0 -20
  160. data/lib/lono/app_file/build.rb +0 -79
  161. data/lib/lono/app_file/registry/item.rb +0 -24
  162. data/lib/lono/app_file/registry.rb +0 -16
  163. data/lib/lono/app_file/upload.rb +0 -12
  164. data/lib/lono/builder/context/loader/load_files.rb +0 -23
  165. data/lib/lono/builder/context/loader.rb +0 -35
  166. data/lib/lono/builder/context/params.rb +0 -7
  167. data/lib/lono/builder/template/configset_injector.rb +0 -52
  168. data/lib/lono/builder/template/dsl/evaluator/helpers/core_helper.rb +0 -14
  169. data/lib/lono/builder/template/dsl/evaluator/helpers/file_helper.rb +0 -44
  170. data/lib/lono/builder/template/dsl/evaluator/helpers/s3_helper.rb +0 -16
  171. data/lib/lono/builder/template/dsl/evaluator/helpers.rb +0 -16
  172. data/lib/lono/builder/template/dsl/evaluator/squeezer.rb +0 -24
  173. data/lib/lono/builder/template/dsl/evaluator/syntax/extend_with.rb +0 -9
  174. data/lib/lono/builder/template/dsl/evaluator/syntax.rb +0 -11
  175. data/lib/lono/builder/template/dsl/evaluator.rb +0 -45
  176. data/lib/lono/builder/template/dsl/finalizer.rb +0 -12
  177. data/lib/lono/builder/template/evaluate.rb +0 -52
  178. data/lib/lono/builder/template/post_processor.rb +0 -67
  179. data/lib/lono/cli/build.rb +0 -101
  180. data/lib/lono/cli/code.rb +0 -22
  181. data/lib/lono/cli/help/blueprint/new.md +0 -56
  182. data/lib/lono/cli/new/extension.rb +0 -57
  183. data/lib/lono/configset/builder.rb +0 -59
  184. data/lib/lono/configset/combiner.rb +0 -164
  185. data/lib/lono/configset/evaluate_file.rb +0 -8
  186. data/lib/lono/configset/meta/dsl.rb +0 -12
  187. data/lib/lono/configset/meta.rb +0 -19
  188. data/lib/lono/configset/s3_file/build.rb +0 -34
  189. data/lib/lono/configset/s3_file/item.rb +0 -38
  190. data/lib/lono/configset/s3_file/registry.rb +0 -12
  191. data/lib/lono/configset/s3_file/upload.rb +0 -12
  192. data/lib/lono/configset/strategy/base.rb +0 -83
  193. data/lib/lono/configset/strategy/helpers/dsl/core.rb +0 -18
  194. data/lib/lono/configset/strategy/helpers/dsl.rb +0 -8
  195. data/lib/lono/configset/strategy/helpers/erb.rb +0 -9
  196. data/lib/lono/extensions/dsl.rb +0 -8
  197. data/lib/lono/extensions/loader.rb +0 -19
  198. data/lib/lono/extensions.rb +0 -18
  199. data/lib/lono/importer/base.rb +0 -48
  200. data/lib/lono/importer/converter.rb +0 -19
  201. data/lib/lono/importer/download.rb +0 -46
  202. data/lib/lono/importer/dsl.rb +0 -36
  203. data/lib/lono/importer/params.rb +0 -56
  204. data/lib/lono/importer/service/coder.rb +0 -81
  205. data/lib/lono/inspector/base.rb +0 -32
  206. data/lib/lono/lookup.rb +0 -12
  207. data/lib/lono/seeder/service_role.rb +0 -11
  208. data/lib/lono/utils/context.rb +0 -15
  209. data/lib/lono/utils/item/file_methods.rb +0 -29
  210. data/lib/lono/utils/item/zip.rb +0 -42
  211. data/lib/templates/extension/lib/%extension_name%/autoloader.rb.tt +0 -23
  212. data/lib/templates/extension/lib/%extension_name%/helpers/mappings.rb.tt +0 -24
  213. data/lib/templates/extension/lib/%extension_name%/helpers/outputs.rb.tt +0 -7
  214. data/lib/templates/extension/lib/%extension_name%/helpers/parameters.rb.tt +0 -10
  215. data/lib/templates/extension/lib/%extension_name%/helpers/resources/resource.rb.tt +0 -4
  216. data/lib/templates/extension/lib/%extension_name%/helpers/variables.rb.tt +0 -6
  217. data/lib/templates/extension/lib/%extension_name%/version.rb.tt +0 -3
  218. data/lib/templates/extension/lib/%extension_name%.rb.tt +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93888f3a1dc76f9c5e21f98c0edf5d03ee7ba4cdcf9e5a4115b0ee1ce0f3b518
4
- data.tar.gz: 22b18e2ccc2e98a41c57903aef1e67677f40dd48a953359447ef5546942f7ccb
3
+ metadata.gz: 963246c282376afe61a61f60ad1ec0ccb17ee194420d972802868f8574fbc97a
4
+ data.tar.gz: 3e8b4c478d5ee57744ff05ad45023592dffab08825a5af2e044a8656680b0512
5
5
  SHA512:
6
- metadata.gz: 67562f7b0059f63f0cd33c93157f4bc0d7182125305b9602f67cb6d3a13094c1d6c1f84f0fe493800ba917cb2404b0f31c789744ff6ef2232b1629b7b51ef34f
7
- data.tar.gz: 7f9c0b5998e36e2acf9cef7dacdfd115ce8bcb49fde35c6664008fe31820e0ed4ce14c36897fc733c93ac93a5033770d1cdf4bf29d170420cc8335b0432cb35d
6
+ metadata.gz: f8ea0aa2e31ea1dad60b69d7993ef1b6eb9781c1ee0d04770ed2a1eb0fec9387703e79b95faf1a04918685d147ff884a7f712420891dbb50f9091bdf3439fa9b
7
+ data.tar.gz: f73dd80095b287c9be478a68c4de4181fdd0657153d69dc0c72145497555a7c542096e8bd0fb5b85877589251d878cd2dee7cace277614917dcab383991de30f
@@ -1,7 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
3
  final_status=0
4
- function final_status {
4
+ function capture_status {
5
5
  if [ "$?" -ne "0" ] && [ $final_status -ne 1 ] ; then
6
6
  final_status=1
7
7
  fi
@@ -32,21 +32,21 @@ lono new blueprint demo --examples
32
32
  set +e
33
33
  # Test new stack creation
34
34
  lono up demo -y
35
- final_status
35
+ capture_status
36
36
 
37
37
  lono seed demo # just to test it. will overwrite file
38
- final_status
38
+ capture_status
39
39
 
40
40
  # Test stack update
41
41
  cat << EOF > config/blueprints/demo/params/$LONO_ENV.txt
42
42
  AccessControl=PublicRead
43
43
  EOF
44
44
  lono up demo -y
45
- final_status
45
+ capture_status
46
46
 
47
47
  # Clean up resources
48
48
  lono down demo -y
49
- final_status
49
+ capture_status
50
50
  set -e
51
51
 
52
52
  exit $final_status
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: Reproducible Bug Report
3
+ about: Is something not working as expected?
4
+ title: ''
5
+ labels: 'bug'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ <!--
11
+ Hi! Thanks for considering to file a bug with Lono. Please take the time to
12
+ answer the basic questions. Please try to be as detailed as possible.
13
+ To be sensitive to everyone's time, if not enough details are provided, the
14
+ issue may be closed without comment. If you repeatedly fail to provide enough
15
+ details, you may be blocked from ever submitting issues to Lono again.
16
+ Please use your best judgment. 👍
17
+
18
+ If you are unsure this is a bug in Lono, please consider asking your question at:
19
+ https://community.boltops.com
20
+
21
+ Thanks!
22
+ -->
23
+
24
+ ## Checklist
25
+
26
+ <!--
27
+ Make sure that you've done all of these. To mark a checkbox done, replace [ ] with [x]. Or after you create the issue you can click the checkbox.
28
+ -->
29
+
30
+ - [ ] Upgrade Lono: Are you using the latest version of Lono? This allows Lono to fix issues fast. There's an Upgrading Guide: https://lono.cloud/docs/upgrading/
31
+ - [ ] Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on https://community.boltops.com
32
+ - [ ] Code sample: Have you put together a code sample to reproduce the issue and make it available? Code samples help speed up fixes dramatically. If it's an easily reproducible issue, then code samples are not needed. If you're unsure, please include a code sample.
33
+
34
+ ## My Environment
35
+
36
+ <!-- Please fill out the table below with debugging info to help: -->
37
+
38
+ | Software | Version |
39
+ | ---------------- | ------- |
40
+ | Operating System | |
41
+ | Lono | |
42
+ | Ruby | |
43
+
44
+ ---
45
+
46
+ ## Expected Behaviour
47
+
48
+ <!--
49
+ What is it you expected to happen? This should be a description of how the functionality you tried to use is supposed to work. Try to keep this to one-paragraph.
50
+ -->
51
+
52
+ ## Current Behavior
53
+
54
+ <!--
55
+ Describe the details of the bug. Try to keep this to one-paragraph.
56
+ -->
57
+
58
+ ## Step-by-step reproduction instructions
59
+
60
+ <!--
61
+ Be sure to include any steps you took for the problem to exist. This is likely the longest part of the report.
62
+
63
+ Please include any logs you think relevant here. If the logs are long (more than 50 lines) please make a gist of the logs and link to it. https://gist.github.com
64
+
65
+ With long logs, you can also use the <details> tag to keep the report readable. Example:
66
+
67
+ <details>
68
+ <summary>Summary Goes Here</summary>
69
+
70
+ ...this is hidden, collapsable content. start with a blank line to get terminal output to format right...
71
+ </details>
72
+ -->
73
+
74
+ ## Code Sample
75
+
76
+ <!--
77
+ Please provide a code repository, gist, code snippet or sample files to reproduce the issue.
78
+ -->
79
+
80
+ ## Solution Suggestion
81
+
82
+ <!--
83
+ Please provide possible solutions. If you can't think of anything, feel free to omit. Please be kind and add helpful possible solutions. For example, "Fix it!" is not a helpful solution suggestion. We are mere mortals. Please be constructive.
84
+ -->
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: Documentation
3
+ about: Found a typo or something that isn't crystal clear in the docs?
4
+ title: ''
5
+ labels: docs
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ The Lono Docs are in the [lono-docs repo](https://github.com/boltops-tools/lono-docs). Please submit a PR there. Thanks!
11
+
12
+ For documentation changes to the lono code base itself, like code comments. Please submit a PR here. Thanks!
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: New Feature Suggestion
3
+ about: Want to add a feature to Lono?
4
+ title: ''
5
+ labels: feature
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ <!--
11
+ Hi! Thanks for considering to file a feature request with Lono. Please take the time to answer the basic questions. Please try to be as detailed as possible.
12
+
13
+ Thanks!
14
+ -->
15
+
16
+ ## Summary
17
+
18
+ <!--
19
+ A one-paragraph explanation of the feature.
20
+ -->
21
+
22
+ ## Motivation
23
+
24
+ <!--
25
+ Why do you want to see this feature in Lono? What use cases does it support?
26
+
27
+ How the feature would be relevant to 80% or more of Lono users.
28
+ -->
29
+
30
+ ## Guide-level explanation
31
+
32
+ <!--
33
+ Explain the proposal as if it was already included in the project and you were teaching it to another programmer. That generally means:
34
+
35
+ - Introducing new named concepts.
36
+ - Explaining the feature largely in terms of examples.
37
+ - If applicable, provide sample error messages, deprecation warnings, or upgrade guidance.
38
+
39
+ If this is a small feature, you may omit this section.
40
+ -->
41
+
42
+ ## Reference-level explanation
43
+
44
+ <!--
45
+ This is the technical portion of the feature request. Explain the design in sufficient detail that:
46
+
47
+ - Its interaction with other features is clear.
48
+ - It is reasonably clear how the feature would be implemented.
49
+ - Corner cases are dissected by example.
50
+
51
+ If you do not know how to answer this, you can omit it. No worries!
52
+ -->
53
+
54
+ ## Drawbacks
55
+
56
+ <!--
57
+ Why should we *not* do this?
58
+ -->
59
+
60
+ ## Unresolved Questions
61
+
62
+ <!--
63
+ What related issues do you consider out of scope for this feature that could be addressed in the future independently of the solution that comes out of this feature?
64
+ -->
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: Question
3
+ about: Have any questions about how Lono works?
4
+ title: ''
5
+ labels: 'question'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ The Lono issue tracker IS NOT for usage questions! Please post your question on our dedicated forum at https://community.boltops.com
11
+
12
+ To be sensitive to everyone's time, we may close issues asking questions without comment. If you repeatedly post questions in the issues tracker, you may be blocked from ever submitting issues to Lono again. Please use your best judgment. 👍
13
+
14
+ Posting your questions in the Lono community forum benefits others by grouping questions in a dedicated place. Here are some additional options also https://lono.cloud/support/ 😁
@@ -0,0 +1,7 @@
1
+ Please fill out one of the templates on https://github.com/boltops-tools/lono/issues/new/choose
2
+
3
+ If you want to ask a question please do so in the Lono category in the BoltOps Community forum: https://community.boltops.com
4
+
5
+ To be sensitive to everyone's time, we may close issues asking questions without comment. Posting your questions in the Lono community forum is the best place. It also benefits others by making the questions easier to find. Here are some additional options also https://lono.cloud/support/ 👌
6
+
7
+ Thank you!
@@ -0,0 +1,50 @@
1
+ <!--
2
+ Thanks for creating a Pull Request! Before you submit, please make sure you've done the following:
3
+
4
+ - I read the contributing document at https://lono.cloud/docs/contributing/
5
+ -->
6
+
7
+ <!--
8
+ Make our lives easier! Choose one of the following by uncommenting it:
9
+ -->
10
+
11
+ <!-- This is a 🐞 bug fix. -->
12
+ <!-- This is a 🙋‍♂️ feature or enhancement. -->
13
+ <!-- This is a 🧐 documentation change. -->
14
+
15
+ <!--
16
+ Before you submit this pull request, make sure to have a look at the following checklist. To mark a checkbox done, replace [ ] with [x]. Or after you create the issue you can click the checkbox.
17
+
18
+ If you don't know how to do some of these, that's fine! Submit your pull request and we will help you out on the way.
19
+ -->
20
+
21
+ - [ ] I've added tests (if it's a bug, feature or enhancement)
22
+ - [ ] I've adjusted the documentation (if it's a feature or enhancement)
23
+ - [ ] The test suite passes (run `bundle exec rspec` to verify this)
24
+
25
+ ## Summary
26
+
27
+ <!--
28
+ Provide a description of what your pull request changes.
29
+ -->
30
+
31
+ ## Context
32
+
33
+ <!--
34
+ Is this related to any GitHub issue(s) or another relevant link?
35
+ -->
36
+
37
+ ## How to Test
38
+
39
+ <!--
40
+ Please provide instructions on how to test the fix. This speeds up reviewing the PR. If testing requires a demo Lono project, please provide an example repo.
41
+ -->
42
+
43
+
44
+ ## Version Changes
45
+
46
+ <!--
47
+ Which semantic version change would you recommend?
48
+ If you don't know, feel free to omit it.
49
+ -->
50
+
data/CHANGELOG.md CHANGED
@@ -1,7 +1,64 @@
1
1
  # Change Log
2
2
 
3
- All notable changes to this project will be documented in this file.
4
- This project *tries* to adhere to [Semantic Versioning](http://semver.org/).
3
+ ## [8.0.0.rc4] - 2022-03-19
4
+
5
+ Notable:
6
+
7
+ * lono app and role concept
8
+ * extra layering support
9
+ * hooks support: project and blueprint level
10
+
11
+ Misc:
12
+
13
+ * add lono bucket output
14
+ * alias blueprint with -b
15
+ * change params extension to .env
16
+ * config.hooks.show = true default
17
+ * config.layering.show = true option
18
+ * extra layering support
19
+ * github templates
20
+ * improve simplier new helper cli interface
21
+ * improve squeezer: edge case Array with nil elements
22
+ * hooks generator
23
+ * lambda layer
24
+ * layering full mode default
25
+ * lazy create lono stack and lono bucket
26
+ * lono extra support
27
+ * lono iam
28
+ * lono summary
29
+ * lono up: edge case fix continue after rollback
30
+ * parse_for_layering_show
31
+ * remove extensions and add new hook generator
32
+ * show configset layering
33
+ * update dsl_evaluator dependency to at least 0.3.0
34
+ * version structure check
35
+
36
+ ## [8.0.0.rc3] - 2022-03-06
37
+
38
+ * lono files support for lambda functions
39
+ * new structure: remove Appfile
40
+ * allow regions and envs support
41
+ * print friend message with exact line of yaml code in case of aws
42
+ * cloudformation yaml validation error
43
+ * improve cli help
44
+ * configsets new structure
45
+ * lono new helper blueprint and project commands
46
+ * project helpers support
47
+ * include_modules improvements
48
+ * support vendor level helpers
49
+ * improve plan params diff
50
+ * lono plan build all first
51
+
52
+ ## [8.0.0.rc2] - 2022-02-23
53
+
54
+ * restructure builder and helpers
55
+ * improve template_evaluation_error
56
+ * lono seed --where option and config.seed.where
57
+ * return nil when output not found
58
+ * setup configsets finalizer
59
+ * template_file helper
60
+ * fix coder
61
+ * lono s3 bucket auto-creation
5
62
 
6
63
  ## [8.0.0.rc1] - 2022-02-21
7
64
 
data/Gemfile CHANGED
@@ -3,8 +3,6 @@ source "https://rubygems.org"
3
3
  # Specify your gem dependencies in lono.gemspec
4
4
  gemspec
5
5
 
6
- if ENV['C9_USER']
7
- gem "rspec-lono", path: "~/boltops-tools/rspec-lono"
8
- else
6
+ group :test do
9
7
  gem "rspec-lono", git: "https://github.com/boltops-tools/rspec-lono", branch: "master"
10
8
  end
data/README.md CHANGED
@@ -27,18 +27,13 @@ Lono is a CloudFormation framework. It builds, manages, and deploys CloudFormati
27
27
 
28
28
  See [lono.cloud](http://lono.cloud) for full lono documentation.
29
29
 
30
- ## Upgrading
31
-
32
- If you are on version 6 and upgrading to 7. You can run [lono upgrade](https://lono.cloud/reference/lono-upgrade/) within your project. Refer to the [Upgrading Guide](https://lono.cloud/docs/extras/upgrading/).
33
-
34
30
  ## Quick Usage
35
31
 
36
32
  It only takes a couple of commands to start using lono.
37
33
 
38
- gem install lono
39
- lono new infra
34
+ gem install lono --prerelease
35
+ lono new project infra --examples
40
36
  cd infra
41
- lono blueprint new demo
42
37
  lono up demo
43
38
 
44
39
  ![Lono flowchart](https://lono.cloud/img/tutorial/lono-flowchart.png "Lono flowchart")
@@ -0,0 +1,12 @@
1
+ class Lono::App::CallableOption
2
+ module Concern
3
+ def callable_option(options={})
4
+ callable_option = Lono::App::CallableOption.new(
5
+ config_name: options[:config_name],
6
+ config_value: options[:config_value],
7
+ passed_args: options[:passed_args],
8
+ )
9
+ callable_option.object
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,56 @@
1
+ # Class represents a lono option that is possibly callable. Examples:
2
+ #
3
+ # config.allow.envs
4
+ # config.allow.regions
5
+ # config.deny.envs
6
+ # config.deny.regions
7
+ #
8
+ # Abstraction is definitely obtuse. Using it to get rid of duplication.
9
+ #
10
+ class Lono::App
11
+ class CallableOption
12
+ include Lono::Utils::Logging
13
+
14
+ def initialize(options={})
15
+ @options = options
16
+ # Example:
17
+ # config_name: config.allow.envs
18
+ # config_value: ["dev"]
19
+ # args: [@stack_name] # passed to object.call
20
+ @config_name = options[:config_name]
21
+ @config_value = options[:config_value]
22
+ @passed_args = options[:passed_args]
23
+ end
24
+
25
+ # Returns either an Array or nil
26
+ def object
27
+ case @config_value
28
+ when nil
29
+ return nil
30
+ when Array
31
+ return @config_value
32
+ when -> (c) { c.respond_to?(:public_instance_methods) && c.public_instance_methods.include?(:call) }
33
+ object= @config_value.new
34
+ when -> (c) { c.respond_to?(:call) }
35
+ object = @config_value
36
+ else
37
+ raise "Invalid option for #{@config_name}"
38
+ end
39
+
40
+ if object
41
+ result = @passed_args.empty? ? object.call : object.call(*@passed_args)
42
+ unless result.is_a?(Array) || result.is_a?(NilClass)
43
+ message = "ERROR: The #{@config_name} needs to return an Array or nil"
44
+ logger.info message.color(:yellow)
45
+ logger.info <<~EOL
46
+ The #{@config_name} when assigned a class, object, or proc must implement
47
+ the call method and return an Array or nil.
48
+ The current return value is a #{result.class}
49
+ EOL
50
+ raise message
51
+ end
52
+ end
53
+ result
54
+ end
55
+ end
56
+ end
data/lib/lono/app.rb CHANGED
@@ -13,6 +13,21 @@ module Lono
13
13
  def defaults
14
14
  config = ActiveSupport::OrderedOptions.new
15
15
 
16
+ config.allow = ActiveSupport::OrderedOptions.new
17
+ config.allow.envs = nil
18
+ config.allow.regions = nil
19
+ config.deny = ActiveSupport::OrderedOptions.new
20
+ config.deny.envs = nil
21
+ config.deny.regions = nil
22
+
23
+ config.hooks = ActiveSupport::OrderedOptions.new
24
+ config.hooks.show = true
25
+
26
+ config.layering = ActiveSupport::OrderedOptions.new
27
+ config.layering.names = {}
28
+ config.layering.mode = "full" # simple or fulll. simple does not include region, account, and region/account layers
29
+ config.layering.show = show_layers?
30
+
16
31
  config.log = ActiveSupport::OrderedOptions.new
17
32
  config.log.root = Lono.log_root
18
33
  config.logger = lono_logger
@@ -20,16 +35,19 @@ module Lono
20
35
  config.logger.level = ENV['LONO_LOG_LEVEL'] || :info
21
36
 
22
37
  config.names = ActiveSupport::OrderedOptions.new
23
- config.names.stack = ":APP-:BLUEPRINT-:ENV"
24
38
  config.names.output = ActiveSupport::OrderedOptions.new
25
- config.names.output.stack = ":BLUEPRINT-:ENV" # does not include APP by default. Think this is more common
26
- config.names.output.expand = true
39
+ config.names.stack = ":APP-:ROLE-:BLUEPRINT-:ENV-:EXTRA"
27
40
 
28
- config.paths = ActiveSupport::OrderedOptions.new
29
- config.paths.scripts = "scripts"
30
- config.paths.content = "content"
31
- config.paths.helpers = "helpers"
32
- config.paths.user_data = "user_data"
41
+ config.plan = ActiveSupport::OrderedOptions.new
42
+ config.plan.changeset = true
43
+ config.plan.params = "full"
44
+ config.plan.template = "summary" # summary is same as true
45
+
46
+ config.seed = ActiveSupport::OrderedOptions.new
47
+ config.seed.where = "config"
48
+
49
+ config.test = ActiveSupport::OrderedOptions.new
50
+ config.test.framework = "rspec"
33
51
 
34
52
  config.up = ActiveSupport::OrderedOptions.new
35
53
  config.up.capabilities = nil
@@ -37,21 +55,39 @@ module Lono
37
55
  config.up.rollback = true
38
56
  config.up.tags = nil
39
57
 
40
- config.diff = ActiveSupport::OrderedOptions.new
41
- config.diff.changeset = true
42
- config.diff.params = "full"
43
- config.diff.template = "summary" # summary is same as true
44
-
45
- config.extract_scripts = {}
46
-
47
- config.test = ActiveSupport::OrderedOptions.new
48
- config.test.framework = "rspec"
58
+ config
59
+ end
49
60
 
50
- config.layering = ActiveSupport::OrderedOptions.new
51
- config.layering.names = {}
61
+ def show_layers?
62
+ ENV['LONO_SHOW_LAYERS'] || parse_for_layering_show
63
+ end
64
+ private :show_layers?
52
65
 
53
- config
66
+ # Some limitations:
67
+ #
68
+ # * Only parsing one file: .ufo/config.rb
69
+ # * If user is using Ruby code that cannot be parse will fallback to default
70
+ #
71
+ # Think it's worth it so user only has to configure
72
+ #
73
+ # config.layering.show = true
74
+ #
75
+ def parse_for_layering_show
76
+ return false if Lono::Command.non_project_command?
77
+ lines = IO.readlines("#{Lono.root}/config/app.rb")
78
+ config_line = lines.find { |l| l =~ /config\.layering.show.*=/ && l !~ /^\s+#/ }
79
+ return false unless config_line # default is false
80
+ config_value = config_line.gsub(/.*=/,'').strip.gsub(/["']/,'')
81
+ config_value != "false" && config_value != "nil"
82
+ rescue Exception => e
83
+ if ENV['LONO_DEBUG']
84
+ puts "#{e.class} #{e.message}".color(:yellow)
85
+ puts "WARN: Unable to parse for config.layering.show".color(:yellow)
86
+ puts "Using default: config.layering.show = false"
87
+ end
88
+ false
54
89
  end
90
+ memoize :parse_for_layering_show
55
91
 
56
92
  def lono_logger
57
93
  Logger.new(ENV['LONO_LOG_PATH'] || $stderr)
@@ -17,6 +17,7 @@ module Lono
17
17
  loader.inflector = Inflector.new
18
18
  loader.push_dir(File.dirname(__dir__)) # lib
19
19
  loader.log! if ENV["LONO_AUTOLOAD_LOG"]
20
+ loader.ignore("#{__dir__}/ext.rb")
20
21
  loader.setup
21
22
  end
22
23
  end
@@ -1,8 +1,6 @@
1
1
  module Lono::AwsServices
2
2
  module Helper
3
3
  def stack_exists?(stack_name)
4
- return false if ENV['LONO_NOOP']
5
-
6
4
  exist = nil
7
5
  begin
8
6
  # When the stack does not exist an exception is raised. Example:
@@ -1,22 +1,5 @@
1
1
  module Lono
2
- class Blueprint
3
- attr_reader :name
4
- def initialize(options={})
5
- @options = options
6
- @name = options[:blueprint]
7
- end
8
-
9
- def exist?
10
- !root.nil?
11
- end
12
-
13
- def root
14
- paths = Dir.glob("#{Lono.root}/{app,vendor}/blueprints/*")
15
- paths.find do |path|
16
- path.include?("blueprints/#{@name}")
17
- end
18
- end
19
-
2
+ class Blueprint < Component
20
3
  def output_path
21
4
  "#{Lono.root}/output/#{@name}/template.yml"
22
5
  end
@@ -0,0 +1,54 @@
1
+ class Lono::Builder::Allow
2
+ class Base < Lono::CLI::Base
3
+ include Lono::App::CallableOption::Concern
4
+
5
+ def check!
6
+ messages = []
7
+ unless allowed?
8
+ messages << message # message is interface method
9
+ end
10
+ unless messages.empty?
11
+ puts "ERROR: The configs do not allow this.".color(:red)
12
+ puts messages
13
+ exit 1
14
+ end
15
+ end
16
+
17
+ def allowed?
18
+ if allows.nil? && denys.nil?
19
+ true
20
+ elsif denys.nil?
21
+ allows.include?(check_value)
22
+ elsif allows.nil?
23
+ !denys.include?(check_value)
24
+ else
25
+ allows.include?(check_value) && !denys.include?(check_value)
26
+ end
27
+ end
28
+
29
+ def allows
30
+ callable_option(
31
+ config_name: "config.allow.#{config_name}",
32
+ config_value: config.dig(:allow, config_name),
33
+ passed_args: [@blueprint],
34
+ )
35
+ end
36
+
37
+ def denys
38
+ callable_option(
39
+ config_name: "config.deny.#{config_name}",
40
+ config_value: config.dig(:deny, config_name),
41
+ passed_args: [@blueprint],
42
+ )
43
+ end
44
+
45
+ private
46
+ def config
47
+ Lono.config
48
+ end
49
+
50
+ def config_name
51
+ self.class.to_s.split('::').last.underscore.pluralize.to_sym # ActiveSuport::HashWithIndifferentAccess#dig requires symbol
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,17 @@
1
+ class Lono::Builder::Allow
2
+ class Env < Base
3
+ # interface method
4
+ def message
5
+ messages = []
6
+ messages << "This env is not allowed to be used: LONO_ENV=#{Lono.env}"
7
+ messages << "Allow envs: #{allows.join(', ')}" if allows
8
+ messages << "Deny envs: #{denys.join(', ')}" if denys
9
+ messages.join("\n")
10
+ end
11
+
12
+ # interface method
13
+ def check_value
14
+ Lono.env
15
+ end
16
+ end
17
+ end