lono 7.5.2 → 8.0.0.pre.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (458) hide show
  1. checksums.yaml +4 -4
  2. data/.cody/README.md +5 -15
  3. data/.cody/acceptance/bin/build.sh +52 -0
  4. data/.cody/acceptance/buildspec.yml +10 -0
  5. data/.cody/acceptance/project.rb +6 -0
  6. data/.cody/{role.rb → acceptance/role.rb} +0 -0
  7. data/.cody/shared/script/install/lono.sh +40 -0
  8. data/.cody/shared/script/install.sh +5 -0
  9. data/CHANGELOG.md +21 -4
  10. data/CONTRIBUTING.md +2 -2
  11. data/Gemfile +5 -1
  12. data/LICENSE.txt +201 -1
  13. data/README.md +4 -4
  14. data/lib/lono/api/client.rb +3 -2
  15. data/lib/lono/app/inits.rb +13 -0
  16. data/lib/lono/app.rb +71 -0
  17. data/lib/lono/app_file/base.rb +1 -1
  18. data/lib/lono/app_file/build/lambda_layer/ruby_packager.rb +9 -9
  19. data/lib/lono/app_file/build/lambda_layer.rb +3 -3
  20. data/lib/lono/app_file/build.rb +9 -14
  21. data/lib/lono/app_file/registry/item.rb +4 -4
  22. data/lib/lono/app_file/upload.rb +1 -1
  23. data/lib/lono/autoloader.rb +2 -2
  24. data/lib/lono/aws_services/helper.rb +43 -6
  25. data/lib/lono/aws_services.rb +37 -6
  26. data/lib/lono/blueprint.rb +18 -9
  27. data/lib/lono/booter.rb +28 -0
  28. data/lib/lono/{template → builder}/context/helpers.rb +1 -1
  29. data/lib/lono/{template → builder}/context/loader/load_files.rb +5 -6
  30. data/lib/lono/builder/context/loader.rb +35 -0
  31. data/lib/lono/builder/context/params.rb +7 -0
  32. data/lib/lono/{template → builder}/context/ssm_fetcher.rb +1 -1
  33. data/lib/lono/{template → builder}/context.rb +5 -9
  34. data/lib/lono/{param/generator.rb → builder/param.rb} +21 -22
  35. data/lib/lono/builder/template/aws_service.rb +15 -0
  36. data/lib/lono/builder/template/bashify.rb +43 -0
  37. data/lib/lono/{template → builder/template}/configset_injector.rb +4 -4
  38. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/fn.rb +2 -2
  39. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers/core_helper.rb +1 -1
  40. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers/ec2_helper.rb +1 -1
  41. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers/file_helper.rb +8 -12
  42. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers/s3_helper.rb +2 -2
  43. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers/stack_helper.rb +11 -8
  44. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers/tags_helper.rb +1 -1
  45. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers.rb +2 -2
  46. data/lib/lono/builder/template/dsl/evaluator/section/base.rb +23 -0
  47. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/condition.rb +1 -1
  48. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/mapping.rb +1 -1
  49. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/methods.rb +7 -7
  50. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/output.rb +1 -1
  51. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/parameter.rb +1 -1
  52. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/resource/property_mover.rb +1 -1
  53. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/resource.rb +1 -1
  54. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/section.rb +1 -1
  55. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/squeezer.rb +1 -1
  56. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/stringify.rb +1 -1
  57. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/syntax/extend_with.rb +1 -1
  58. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/syntax/parameter_group.rb +1 -1
  59. data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/syntax.rb +3 -3
  60. data/lib/lono/builder/template/dsl/evaluator.rb +45 -0
  61. data/lib/lono/{template/strategy → builder/template}/dsl/finalizer/parameter_groups.rb +2 -2
  62. data/lib/lono/{template/strategy → builder/template}/dsl/finalizer.rb +1 -1
  63. data/lib/lono/builder/template/dsl.rb +14 -0
  64. data/lib/lono/{template → builder/template}/evaluate.rb +18 -6
  65. data/lib/lono/builder/template/helpers.rb +149 -0
  66. data/lib/lono/{output/template.rb → builder/template/output.rb} +14 -7
  67. data/lib/lono/{template → builder/template}/post_processor.rb +4 -4
  68. data/lib/lono/{template → builder/template}/upload.rb +3 -5
  69. data/lib/lono/builder/template.rb +55 -0
  70. data/lib/lono/bundler/cli/base.rb +10 -0
  71. data/lib/lono/bundler/cli/bundle.rb +44 -0
  72. data/lib/lono/bundler/cli/clean.rb +27 -0
  73. data/lib/lono/bundler/cli/help/bundle.md +3 -0
  74. data/lib/lono/bundler/cli/help.rb +11 -0
  75. data/lib/lono/bundler/cli.rb +7 -0
  76. data/lib/lono/bundler/component/concerns/local_concern.rb +10 -0
  77. data/lib/lono/bundler/component/concerns/notation_concern.rb +59 -0
  78. data/lib/lono/bundler/component/concerns/path_concern.rb +68 -0
  79. data/lib/lono/bundler/component/concerns/stack_concern.rb +60 -0
  80. data/lib/lono/bundler/component/fetcher/base.rb +27 -0
  81. data/lib/lono/bundler/component/fetcher/gcs.rb +69 -0
  82. data/lib/lono/bundler/component/fetcher/git.rb +69 -0
  83. data/lib/lono/bundler/component/fetcher/local.rb +15 -0
  84. data/lib/lono/bundler/component/fetcher/s3.rb +66 -0
  85. data/lib/lono/bundler/component/fetcher.rb +18 -0
  86. data/lib/lono/bundler/component/http/concern.rb +45 -0
  87. data/lib/lono/bundler/component/http/source.rb +19 -0
  88. data/lib/lono/bundler/component/org_repo.rb +65 -0
  89. data/lib/lono/bundler/component/props/extension.rb +19 -0
  90. data/lib/lono/bundler/component/props/typer.rb +41 -0
  91. data/lib/lono/bundler/component/props.rb +122 -0
  92. data/lib/lono/bundler/component/registry.rb +136 -0
  93. data/lib/lono/bundler/component.rb +52 -0
  94. data/lib/lono/bundler/config.rb +18 -0
  95. data/lib/lono/bundler/dsl/syntax.rb +46 -0
  96. data/lib/lono/bundler/dsl.rb +21 -0
  97. data/lib/lono/bundler/exporter/base.rb +6 -0
  98. data/lib/lono/bundler/exporter/copy.rb +22 -0
  99. data/lib/lono/bundler/exporter.rb +50 -0
  100. data/lib/lono/bundler/extract/tar.rb +34 -0
  101. data/lib/lono/bundler/extract/zip.rb +16 -0
  102. data/lib/lono/bundler/info.rb +39 -0
  103. data/lib/lono/bundler/list.rb +26 -0
  104. data/lib/lono/bundler/lockfile/version_comparer.rb +56 -0
  105. data/lib/lono/bundler/lockfile/yamler.rb +36 -0
  106. data/lib/lono/bundler/lockfile.rb +66 -0
  107. data/lib/lono/bundler/lonofile.rb +32 -0
  108. data/lib/lono/bundler/runner.rb +27 -0
  109. data/lib/lono/bundler/syncer.rb +70 -0
  110. data/lib/lono/bundler/util/git.rb +37 -0
  111. data/lib/lono/bundler/util/logging.rb +7 -0
  112. data/lib/lono/bundler/util/sure.rb +5 -0
  113. data/lib/lono/{bundle.rb → bundler.rb} +38 -4
  114. data/lib/lono/cfn/base.rb +9 -195
  115. data/lib/lono/cfn/cancel.rb +9 -26
  116. data/lib/lono/cfn/concerns/build.rb +10 -0
  117. data/lib/lono/cfn/concerns/template_output.rb +10 -0
  118. data/lib/lono/cfn/concerns.rb +43 -0
  119. data/lib/lono/cfn/delete.rb +8 -32
  120. data/lib/lono/cfn/deploy/base.rb +4 -0
  121. data/lib/lono/cfn/deploy/iam.rb +49 -0
  122. data/lib/lono/cfn/deploy/notification.rb +8 -0
  123. data/lib/lono/cfn/deploy/operable.rb +18 -0
  124. data/lib/lono/cfn/deploy/opts.rb +49 -0
  125. data/lib/lono/cfn/deploy/rollback.rb +46 -0
  126. data/lib/lono/cfn/deploy/tags.rb +18 -0
  127. data/lib/lono/cfn/deploy.rb +71 -5
  128. data/lib/lono/cfn/download.rb +5 -7
  129. data/lib/lono/cfn/output.rb +49 -0
  130. data/lib/lono/cfn/plan/base.rb +19 -0
  131. data/lib/lono/cfn/plan/changeset/base.rb +19 -0
  132. data/lib/lono/cfn/plan/changeset/notifications.rb +24 -0
  133. data/lib/lono/cfn/plan/changeset/outputs.rb +25 -0
  134. data/lib/lono/cfn/plan/changeset/resources.rb +48 -0
  135. data/lib/lono/cfn/plan/changeset/tags.rb +16 -0
  136. data/lib/lono/cfn/plan/changeset.rb +136 -0
  137. data/lib/lono/cfn/plan/concerns.rb +10 -0
  138. data/lib/lono/cfn/plan/delete.rb +16 -0
  139. data/lib/lono/cfn/plan/diff/base.rb +10 -0
  140. data/lib/lono/cfn/plan/diff/data.rb +52 -0
  141. data/lib/lono/cfn/plan/diff/file.rb +56 -0
  142. data/lib/lono/cfn/plan/new.rb +26 -0
  143. data/lib/lono/cfn/{preview → plan}/param.rb +26 -34
  144. data/lib/lono/cfn/plan/summary.rb +16 -0
  145. data/lib/lono/cfn/plan/template.rb +28 -0
  146. data/lib/lono/cfn/plan.rb +33 -0
  147. data/lib/lono/cfn/show.rb +30 -0
  148. data/lib/lono/cfn/status.rb +1 -1
  149. data/lib/lono/cli/abstract.rb +17 -0
  150. data/lib/lono/cli/base.rb +9 -0
  151. data/lib/lono/cli/build.rb +101 -0
  152. data/lib/lono/cli/bundle.rb +21 -0
  153. data/lib/lono/cli/cfn/opts.rb +59 -0
  154. data/lib/lono/cli/cfn.rb +19 -0
  155. data/lib/lono/cli/clean.rb +22 -0
  156. data/lib/lono/{code.rb → cli/code.rb} +2 -2
  157. data/lib/lono/{completion.rb → cli/completion.rb} +2 -2
  158. data/lib/lono/{help → cli/help}/blueprint/new.md +4 -4
  159. data/lib/lono/{help/generate.md → cli/help/build.md} +6 -6
  160. data/lib/lono/{help → cli/help}/cfn/cancel.md +0 -0
  161. data/lib/lono/cli/help/cfn/download.md +3 -0
  162. data/lib/lono/{help → cli/help}/cfn/preview.md +9 -8
  163. data/lib/lono/{help → cli/help}/cfn/status.md +0 -0
  164. data/lib/lono/cli/help/cfn.md +4 -0
  165. data/lib/lono/{help → cli/help}/code/convert.md +0 -0
  166. data/lib/lono/{help → cli/help}/code/import.md +2 -2
  167. data/lib/lono/{help → cli/help}/completion.md +3 -3
  168. data/lib/lono/{help → cli/help}/completion_script.md +0 -0
  169. data/lib/lono/{help → cli/help}/configsets.md +0 -0
  170. data/lib/lono/cli/help/down.md +13 -0
  171. data/lib/lono/cli/help/new/project.md +34 -0
  172. data/lib/lono/{help → cli/help}/param/generate.md +0 -0
  173. data/lib/lono/cli/help/param.md +6 -0
  174. data/lib/lono/{help → cli/help}/pro/blueprints.md +0 -0
  175. data/lib/lono/{help → cli/help}/pro/configsets.md +0 -0
  176. data/lib/lono/{help → cli/help}/script/build.md +0 -0
  177. data/lib/lono/{help → cli/help}/script/upload.md +0 -0
  178. data/lib/lono/{help → cli/help}/seed.md +2 -2
  179. data/lib/lono/cli/help/summary.md +33 -0
  180. data/lib/lono/{help → cli/help}/template/bashify.md +0 -0
  181. data/lib/lono/cli/help/template/generate.md +7 -0
  182. data/lib/lono/{help → cli/help}/template.md +0 -0
  183. data/lib/lono/cli/help/up.md +30 -0
  184. data/lib/lono/{help → cli/help}/user_data.md +3 -3
  185. data/lib/lono/cli/help.rb +56 -0
  186. data/lib/lono/cli/list.rb +28 -0
  187. data/lib/lono/cli/new/blueprint.rb +33 -0
  188. data/lib/lono/cli/new/concerns.rb +16 -0
  189. data/lib/lono/{configset/new.rb → cli/new/configset.rb} +2 -9
  190. data/lib/lono/{extension/new.rb → cli/new/extension.rb} +2 -10
  191. data/lib/lono/cli/new/helper.rb +32 -0
  192. data/lib/lono/cli/new/project.rb +77 -0
  193. data/lib/lono/cli/new/sequence.rb +51 -0
  194. data/lib/lono/cli/new/shim.rb +59 -0
  195. data/lib/lono/cli/new/test/blueprint.rb +23 -0
  196. data/lib/lono/cli/new/test/sequence.rb +10 -0
  197. data/lib/lono/cli/new/test.rb +8 -0
  198. data/lib/lono/cli/new.rb +31 -0
  199. data/lib/lono/{opts.rb → cli/opts.rb} +9 -12
  200. data/lib/lono/{s3.rb → cli/s3.rb} +9 -7
  201. data/lib/lono/cli/script/base.rb +5 -0
  202. data/lib/lono/cli/script/build.rb +72 -0
  203. data/lib/lono/cli/script/upload.rb +49 -0
  204. data/lib/lono/{script.rb → cli/script.rb} +2 -2
  205. data/lib/lono/cli/seed.rb +9 -0
  206. data/lib/lono/cli/test.rb +35 -0
  207. data/lib/lono/cli.rb +80 -109
  208. data/lib/lono/command.rb +27 -0
  209. data/lib/lono/configset/{generator.rb → builder.rb} +9 -7
  210. data/lib/lono/configset/combiner.rb +8 -6
  211. data/lib/lono/configset/evaluate_file.rb +1 -1
  212. data/lib/lono/configset/meta.rb +1 -1
  213. data/lib/lono/configset/s3_file/build.rb +5 -4
  214. data/lib/lono/configset/s3_file/item.rb +1 -1
  215. data/lib/lono/configset/s3_file/upload.rb +2 -2
  216. data/lib/lono/configset/strategy/base.rb +6 -6
  217. data/lib/lono/configset/strategy/helpers/dsl/core.rb +1 -1
  218. data/lib/lono/core.rb +25 -54
  219. data/lib/lono/extensions/dsl.rb +2 -5
  220. data/lib/lono/extensions/loader.rb +1 -12
  221. data/lib/lono/extensions.rb +2 -2
  222. data/lib/lono/importer/base.rb +5 -5
  223. data/lib/lono/importer/download.rb +7 -7
  224. data/lib/lono/importer/dsl.rb +3 -3
  225. data/lib/lono/importer/service/coder.rb +10 -10
  226. data/lib/lono/importer.rb +1 -10
  227. data/lib/lono/inspector/base.rb +7 -7
  228. data/lib/lono/inspector/summary.rb +19 -17
  229. data/lib/lono/layering/layer.rb +126 -0
  230. data/lib/lono/layering.rb +13 -55
  231. data/lib/lono/logger/formatter.rb +13 -0
  232. data/lib/lono/logger.rb +33 -0
  233. data/lib/lono/lookup.rb +12 -0
  234. data/lib/lono/names.rb +50 -0
  235. data/lib/lono/plugin/meta.rb +30 -0
  236. data/lib/lono/plugin/tester.rb +13 -0
  237. data/lib/lono/plugin.rb +10 -0
  238. data/lib/lono/s3/aws_setup.rb +4 -3
  239. data/lib/lono/s3/bucket.rb +19 -19
  240. data/lib/lono/s3/uploader.rb +10 -12
  241. data/lib/lono/script/base.rb +3 -3
  242. data/lib/lono/script/build.rb +11 -12
  243. data/lib/lono/script/upload.rb +7 -7
  244. data/lib/lono/{seed → seeder}/service_role.rb +1 -1
  245. data/lib/lono/{seed/base.rb → seeder.rb} +21 -36
  246. data/lib/lono/user_data.rb +8 -13
  247. data/lib/lono/utils/context.rb +15 -0
  248. data/lib/lono/utils/item/zip.rb +5 -5
  249. data/lib/lono/utils/logging.rb +7 -0
  250. data/lib/lono/utils/{pretty_time.rb → pretty.rb} +6 -2
  251. data/lib/lono/utils/quit.rb +7 -0
  252. data/lib/lono/utils/rsync.rb +4 -2
  253. data/lib/lono/utils/sure.rb +4 -4
  254. data/lib/lono/version.rb +1 -1
  255. data/lib/lono.rb +7 -12
  256. data/lib/templates/blueprint/template.rb +2 -0
  257. data/lib/templates/configset/{lib/configset.rb → configset.rb} +0 -0
  258. data/lib/templates/examples/blueprint/template.rb +9 -0
  259. data/lib/templates/helper/%underscore_name%_helper.rb.tt +6 -0
  260. data/lib/templates/{skeleton → project}/.gitignore +1 -2
  261. data/lib/templates/project/Gemfile.tt +11 -0
  262. data/lib/templates/project/README.md +9 -0
  263. data/lib/templates/project/config/app.rb +3 -0
  264. data/lib/templates/shim/lono +7 -0
  265. data/lono.gemspec +51 -44
  266. metadata +246 -269
  267. data/.circleci/README.md +0 -3
  268. data/.circleci/config.yml +0 -58
  269. data/.cody/acceptance.sh +0 -49
  270. data/.cody/buildspec.yml +0 -9
  271. data/.cody/demo.rb +0 -38
  272. data/.cody/project.rb +0 -6
  273. data/.gitmodules +0 -3
  274. data/lib/lono/abstract_base.rb +0 -25
  275. data/lib/lono/aws_services/stack.rb +0 -41
  276. data/lib/lono/aws_services/stack_set.rb +0 -41
  277. data/lib/lono/blueprint/configset/loader.rb +0 -7
  278. data/lib/lono/blueprint/helper.rb +0 -24
  279. data/lib/lono/blueprint/meta.rb +0 -30
  280. data/lib/lono/blueprint/new.rb +0 -127
  281. data/lib/lono/blueprint/root.rb +0 -25
  282. data/lib/lono/cfn/create.rb +0 -41
  283. data/lib/lono/cfn/opts.rb +0 -88
  284. data/lib/lono/cfn/preview/changeset.rb +0 -168
  285. data/lib/lono/cfn/preview/codediff.rb +0 -41
  286. data/lib/lono/cfn/preview/diff_viewer.rb +0 -23
  287. data/lib/lono/cfn/rollback.rb +0 -26
  288. data/lib/lono/cfn/update.rb +0 -71
  289. data/lib/lono/cfn.rb +0 -75
  290. data/lib/lono/clean.rb +0 -14
  291. data/lib/lono/configset/list.rb +0 -67
  292. data/lib/lono/configset/preparer.rb +0 -44
  293. data/lib/lono/configset/register/base.rb +0 -122
  294. data/lib/lono/configset/register/blueprint.rb +0 -16
  295. data/lib/lono/configset/register/dsl.rb +0 -14
  296. data/lib/lono/configset/register/project.rb +0 -13
  297. data/lib/lono/configset/resolver.rb +0 -47
  298. data/lib/lono/configset.rb +0 -16
  299. data/lib/lono/conventions.rb +0 -23
  300. data/lib/lono/core/config.rb +0 -22
  301. data/lib/lono/default/settings.yml +0 -21
  302. data/lib/lono/ext/bundler.rb +0 -7
  303. data/lib/lono/extension/helper.rb +0 -13
  304. data/lib/lono/extension/list.rb +0 -40
  305. data/lib/lono/extension.rb +0 -9
  306. data/lib/lono/extensions/preparer.rb +0 -26
  307. data/lib/lono/extensions/register.rb +0 -15
  308. data/lib/lono/file_uploader.rb +0 -21
  309. data/lib/lono/finder/base.rb +0 -152
  310. data/lib/lono/finder/blueprint/configset.rb +0 -17
  311. data/lib/lono/finder/blueprint.rb +0 -11
  312. data/lib/lono/finder/configset.rb +0 -11
  313. data/lib/lono/finder/extension.rb +0 -11
  314. data/lib/lono/generate.rb +0 -111
  315. data/lib/lono/help/cfn/create.md +0 -26
  316. data/lib/lono/help/cfn/delete.md +0 -13
  317. data/lib/lono/help/cfn/deploy.md +0 -21
  318. data/lib/lono/help/cfn/download.md +0 -3
  319. data/lib/lono/help/cfn/update.md +0 -49
  320. data/lib/lono/help/cfn.md +0 -7
  321. data/lib/lono/help/new.md +0 -57
  322. data/lib/lono/help/param.md +0 -6
  323. data/lib/lono/help/set_instances/delete.md +0 -21
  324. data/lib/lono/help/set_instances/deploy.md +0 -31
  325. data/lib/lono/help/set_instances/list.md +0 -14
  326. data/lib/lono/help/set_instances/status.md +0 -15
  327. data/lib/lono/help/set_instances/sync.md +0 -92
  328. data/lib/lono/help/sets/delete.md +0 -8
  329. data/lib/lono/help/sets/deploy.md +0 -76
  330. data/lib/lono/help/sets/status.md +0 -23
  331. data/lib/lono/help/summary.md +0 -33
  332. data/lib/lono/help/template/generate.md +0 -7
  333. data/lib/lono/help/upgrade.md +0 -1
  334. data/lib/lono/help/xgraph.md +0 -16
  335. data/lib/lono/help.rb +0 -15
  336. data/lib/lono/importer/erb.rb +0 -31
  337. data/lib/lono/inspector/graph.rb +0 -125
  338. data/lib/lono/jade/circular.rb +0 -26
  339. data/lib/lono/jade/materializer/final.rb +0 -10
  340. data/lib/lono/jade/materializer/gems_builder.rb +0 -81
  341. data/lib/lono/jade/materializer/source.rb +0 -54
  342. data/lib/lono/jade/materializer.rb +0 -15
  343. data/lib/lono/jade/registry.rb +0 -64
  344. data/lib/lono/jade.rb +0 -110
  345. data/lib/lono/jadespec.rb +0 -68
  346. data/lib/lono/new/helper.rb +0 -15
  347. data/lib/lono/new.rb +0 -95
  348. data/lib/lono/param.rb +0 -14
  349. data/lib/lono/pro/base.rb +0 -16
  350. data/lib/lono/pro/repo.rb +0 -28
  351. data/lib/lono/pro.rb +0 -15
  352. data/lib/lono/project_checker.rb +0 -35
  353. data/lib/lono/registration/base.rb +0 -37
  354. data/lib/lono/registration/check.rb +0 -15
  355. data/lib/lono/registration/temp.rb +0 -53
  356. data/lib/lono/registration/user.rb +0 -60
  357. data/lib/lono/seed.rb +0 -39
  358. data/lib/lono/sequence.rb +0 -35
  359. data/lib/lono/set_instances/base.rb +0 -30
  360. data/lib/lono/set_instances/changeable.rb +0 -53
  361. data/lib/lono/set_instances/create.rb +0 -7
  362. data/lib/lono/set_instances/delete.rb +0 -47
  363. data/lib/lono/set_instances/deploy.rb +0 -52
  364. data/lib/lono/set_instances/list.rb +0 -13
  365. data/lib/lono/set_instances/opts.rb +0 -37
  366. data/lib/lono/set_instances/status.rb +0 -12
  367. data/lib/lono/set_instances/sync.rb +0 -181
  368. data/lib/lono/set_instances/update.rb +0 -15
  369. data/lib/lono/set_instances.rb +0 -54
  370. data/lib/lono/sets/base.rb +0 -50
  371. data/lib/lono/sets/create.rb +0 -27
  372. data/lib/lono/sets/delete.rb +0 -43
  373. data/lib/lono/sets/deploy.rb +0 -11
  374. data/lib/lono/sets/list.rb +0 -35
  375. data/lib/lono/sets/opts.rb +0 -18
  376. data/lib/lono/sets/preview/codediff.rb +0 -35
  377. data/lib/lono/sets/preview/param.rb +0 -32
  378. data/lib/lono/sets/status/instance/base.rb +0 -120
  379. data/lib/lono/sets/status/instance/completed.rb +0 -35
  380. data/lib/lono/sets/status/instance/deleted.rb +0 -32
  381. data/lib/lono/sets/status/instance/show.rb +0 -7
  382. data/lib/lono/sets/status/instance.rb +0 -20
  383. data/lib/lono/sets/status/instances.rb +0 -136
  384. data/lib/lono/sets/status.rb +0 -128
  385. data/lib/lono/sets/summarize.rb +0 -22
  386. data/lib/lono/sets/time_spent.rb +0 -11
  387. data/lib/lono/sets/update.rb +0 -74
  388. data/lib/lono/sets/waiter.rb +0 -23
  389. data/lib/lono/sets.rb +0 -34
  390. data/lib/lono/setting.rb +0 -75
  391. data/lib/lono/template/aws_service.rb +0 -20
  392. data/lib/lono/template/bashify.rb +0 -39
  393. data/lib/lono/template/context/loader.rb +0 -52
  394. data/lib/lono/template/generator.rb +0 -23
  395. data/lib/lono/template/helper.rb +0 -152
  396. data/lib/lono/template/strategy/base.rb +0 -4
  397. data/lib/lono/template/strategy/common/helpers.rb +0 -44
  398. data/lib/lono/template/strategy/dsl/builder/section/base.rb +0 -30
  399. data/lib/lono/template/strategy/dsl/builder.rb +0 -59
  400. data/lib/lono/template/strategy/dsl.rb +0 -14
  401. data/lib/lono/template/strategy/erb.rb +0 -82
  402. data/lib/lono/template/strategy/source.rb +0 -8
  403. data/lib/lono/template/template.rb +0 -54
  404. data/lib/lono/template/util.rb +0 -8
  405. data/lib/lono/template.rb +0 -24
  406. data/lib/lono/upgrade.rb +0 -20
  407. data/lib/lono/utils/generators/tree.rb +0 -18
  408. data/lib/templates/blueprint/%blueprint_name%.gemspec.tt +0 -45
  409. data/lib/templates/blueprint/.gitignore +0 -11
  410. data/lib/templates/blueprint/CHANGELOG.md +0 -7
  411. data/lib/templates/blueprint/Gemfile +0 -4
  412. data/lib/templates/blueprint/README.md.tt +0 -33
  413. data/lib/templates/blueprint/Rakefile.tt +0 -9
  414. data/lib/templates/blueprint/seed/configs.rb +0 -28
  415. data/lib/templates/blueprint_types/dsl/app/templates/%blueprint_name%.rb +0 -36
  416. data/lib/templates/blueprint_types/dsl/app/user_data/bootstrap.sh +0 -2
  417. data/lib/templates/blueprint_types/erb/app/definitions/base.rb.tt +0 -1
  418. data/lib/templates/blueprint_types/erb/app/templates/%blueprint_name%.yml +0 -67
  419. data/lib/templates/configset/%configset_name%.gemspec.tt +0 -42
  420. data/lib/templates/configset/.gitignore +0 -10
  421. data/lib/templates/configset/CHANGELOG.md +0 -7
  422. data/lib/templates/configset/Gemfile +0 -4
  423. data/lib/templates/configset/README.md.tt +0 -3
  424. data/lib/templates/configset/Rakefile.tt +0 -9
  425. data/lib/templates/extension/%extension_name%.gemspec.tt +0 -46
  426. data/lib/templates/extension/.gitignore +0 -11
  427. data/lib/templates/extension/.rspec +0 -3
  428. data/lib/templates/extension/CHANGELOG.md +0 -7
  429. data/lib/templates/extension/Gemfile.tt +0 -4
  430. data/lib/templates/extension/Rakefile.tt +0 -9
  431. data/lib/templates/extension/spec/spec_helper.rb.tt +0 -29
  432. data/lib/templates/skeleton/Gemfile +0 -3
  433. data/lib/templates/skeleton/README.md +0 -58
  434. data/lib/templates/skeleton/configs/settings.yml +0 -13
  435. data/vendor/cfn-status/CHANGELOG.md +0 -14
  436. data/vendor/cfn-status/Gemfile +0 -4
  437. data/vendor/cfn-status/Gemfile.lock +0 -49
  438. data/vendor/cfn-status/LICENSE.txt +0 -21
  439. data/vendor/cfn-status/README.md +0 -58
  440. data/vendor/cfn-status/Rakefile +0 -6
  441. data/vendor/cfn-status/bin/console +0 -14
  442. data/vendor/cfn-status/bin/setup +0 -8
  443. data/vendor/cfn-status/cfn-status.gemspec +0 -30
  444. data/vendor/cfn-status/lib/cfn-status.rb +0 -1
  445. data/vendor/cfn-status/lib/cfn_status/aws_service.rb +0 -51
  446. data/vendor/cfn-status/lib/cfn_status/version.rb +0 -3
  447. data/vendor/cfn-status/lib/cfn_status.rb +0 -245
  448. data/vendor/cfn-status/spec/fixtures/cfn/pages/fresh/describe_stack_events-1.json +0 -1103
  449. data/vendor/cfn-status/spec/fixtures/cfn/pages/fresh/describe_stack_events-2.json +0 -1104
  450. data/vendor/cfn-status/spec/fixtures/cfn/pages/fresh/describe_stack_events-3.json +0 -1103
  451. data/vendor/cfn-status/spec/fixtures/cfn/pages/updating/describe_stack_events-1.json +0 -1103
  452. data/vendor/cfn-status/spec/fixtures/cfn/pages/updating/describe_stack_events-2.json +0 -1104
  453. data/vendor/cfn-status/spec/fixtures/cfn/pages/updating/describe_stack_events-3.json +0 -1103
  454. data/vendor/cfn-status/spec/fixtures/cfn/stack-events-complete.json +0 -1080
  455. data/vendor/cfn-status/spec/fixtures/cfn/stack-events-in-progress.json +0 -1080
  456. data/vendor/cfn-status/spec/fixtures/cfn/stack-events-update-rollback-complete.json +0 -1086
  457. data/vendor/cfn-status/spec/lib/cfn_status_spec.rb +0 -153
  458. data/vendor/cfn-status/spec/spec_helper.rb +0 -14
data/.circleci/config.yml DELETED
@@ -1,58 +0,0 @@
1
- # Ruby CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
- #
5
- version: 2
6
- jobs:
7
- build:
8
- docker:
9
- # specify the version you desire here
10
- - image: circleci/ruby:2.6.5-node-browsers
11
-
12
- # Specify service dependencies here if necessary
13
- # CircleCI maintains a library of pre-built images
14
- # documented at https://circleci.com/docs/2.0/circleci-images/
15
- # - image: circleci/postgres:9.4
16
-
17
- working_directory: ~/repo
18
-
19
- steps:
20
- - checkout
21
-
22
- - run:
23
- name: submodule sync
24
- command: |
25
- git submodule sync
26
- git submodule update --init
27
-
28
- # Download and cache dependencies
29
- - restore_cache:
30
- keys:
31
- - v2-dependencies-{{ checksum "lono.gemspec" }}
32
- # fallback to using the latest cache if no exact match is found
33
- - v2-dependencies-
34
-
35
- - run:
36
- name: install dependencies
37
- command: |
38
- gem install bundler
39
- gem update --system
40
- bundle install --jobs=4 --retry=3 --path vendor/bundle
41
-
42
- - save_cache:
43
- paths:
44
- - ./vendor/bundle
45
- key: v2-dependencies-{{ checksum "lono.gemspec" }}
46
-
47
- # run tests!
48
- - run:
49
- name: run tests
50
- command: |
51
- bundle exec rspec
52
-
53
- # collect reports
54
- - store_test_results:
55
- path: /tmp/test-results
56
- - store_artifacts:
57
- path: /tmp/test-results
58
- destination: test-results
data/.cody/acceptance.sh DELETED
@@ -1,49 +0,0 @@
1
- #!/bin/bash
2
-
3
- gem install bundler # upgrade bundler
4
-
5
- set -exu
6
-
7
- git config --global user.email "tonguerooo@gmail.com"
8
- git config --global user.name "tung"
9
-
10
- # https://unix.stackexchange.com/questions/1496/why-doesnt-my-bash-script-recognize-aliases
11
- shopt -s expand_aliases
12
- alias lono="$(pwd)/exe/lono"
13
-
14
- bundle install --without development test
15
-
16
- rm -rf infra
17
-
18
- lono new infra
19
- cd infra
20
-
21
- # Rewrite the Gemfile to use the local lono gem for testing
22
- cat << EOF > Gemfile
23
- source "https://rubygems.org"
24
- gem "lono", path: "$CODEBUILD_SRC_DIR", submodules: true
25
- EOF
26
- cat Gemfile
27
-
28
- bundle # install lono gem in the infra project
29
-
30
- # Create a demo blueprint
31
- lono blueprint new demo
32
- # Very simply template with just a security group
33
- cp ../.cody/demo.rb app/blueprints/demo/app/templates/demo.rb
34
-
35
- STACK_NAME="demo-$(date +%Y%m%d%H%M%S)"
36
-
37
- # Configure lono registration
38
- mkdir -p .lono
39
- cat << EOF > .lono/registration.yml
40
- ---
41
- name: <%= ssm("/lono/registration/name") %>
42
- company: <%= ssm("/lono/registration/company") %>
43
- email: <%= ssm("/lono/registration/email") %>
44
- registration_key: <%= ssm("/lono/registration/registration_key") %>
45
- EOF
46
-
47
- lono cfn deploy $STACK_NAME --blueprint demo
48
- lono cfn status $STACK_NAME
49
- lono cfn delete $STACK_NAME --sure
data/.cody/buildspec.yml DELETED
@@ -1,9 +0,0 @@
1
- version: 0.2
2
-
3
- phases:
4
- install:
5
- runtime-versions:
6
- ruby: 2.6
7
- build:
8
- commands:
9
- - .cody/acceptance.sh
data/.cody/demo.rb DELETED
@@ -1,38 +0,0 @@
1
- # Acceptance Level Stack
2
- aws_template_format_version "2010-09-09"
3
- description "Demo stack"
4
-
5
- parameter("InstanceType", "t3.micro")
6
-
7
- mapping("AmiMap",
8
- "ap-northeast-1": { Ami: "ami-0f9ae750e8274075b" },
9
- "ap-northeast-2": { Ami: "ami-047f7b46bd6dd5d84" },
10
- "ap-south-1": { Ami: "ami-0889b8a448de4fc44" },
11
- "ap-southeast-1": { Ami: "ami-0b419c3a4b01d1859" },
12
- "ap-southeast-2": { Ami: "ami-04481c741a0311bbb" },
13
- "ca-central-1": { Ami: "ami-03338e1f67dae0168" },
14
- "eu-central-1": { Ami: "ami-09def150731bdbcc2" },
15
- "eu-north-1": { Ami: "ami-d16fe6af" },
16
- "eu-west-1": { Ami: "ami-07683a44e80cd32c5" },
17
- "eu-west-2": { Ami: "ami-09ead922c1dad67e4" },
18
- "eu-west-3": { Ami: "ami-0451ae4fd8dd178f7" },
19
- "sa-east-1": { Ami: "ami-0669a96e355eac82f" },
20
- "us-east-1": { Ami: "ami-0de53d8956e8dcf80" },
21
- "us-east-2": { Ami: "ami-02bcbb802e03574ba" },
22
- "us-west-1": { Ami: "ami-0019ef04ac50be30f" },
23
- "us-west-2": { Ami: "ami-061392db613a6357b" }
24
- )
25
-
26
- # Comment out instance to save costs
27
- # resource(:instance, "AWS::EC2::Instance",
28
- # instance_type: ref(:instance_type),
29
- # image_id: find_in_map(:ami_map, ref("AWS::Region"), :ami),
30
- # security_group_ids: [get_att("security_group.group_id")],
31
- # user_data: base64(user_data("bootstrap.sh"))
32
- # )
33
- resource("SecurityGroup", "AWS::EC2::SecurityGroup",
34
- GroupDescription: "demo security group",
35
- )
36
-
37
- # output(:instance)
38
- output("SecurityGroup", get_att("SecurityGroup.GroupId"))
data/.cody/project.rb DELETED
@@ -1,6 +0,0 @@
1
- github_url("https://github.com/tongueroo/lono")
2
- linux_image("aws/codebuild/amazonlinux2-x86_64-standard:2.0")
3
- triggers(
4
- webhook: true,
5
- filter_groups: [[{type: "EVENT", pattern: "PUSH"}]]
6
- )
data/.gitmodules DELETED
@@ -1,3 +0,0 @@
1
- [submodule "vendor/cfn-status"]
2
- path = vendor/cfn-status
3
- url = https://github.com/tongueroo/cfn-status
@@ -1,25 +0,0 @@
1
- module Lono
2
- class AbstractBase
3
- extend Memoist
4
- include Lono::Blueprint::Root
5
-
6
- def initialize(options={})
7
- reinitialize(options)
8
- end
9
-
10
- # Hack so that we can use include Thor::Base
11
- def reinitialize(options)
12
- @options = options
13
- Lono::ProjectChecker.check
14
- @stack, @blueprint, @template, @param = Conventions.new(options).values
15
-
16
- return if options[:source]
17
- set_blueprint_root(@blueprint)
18
- Lono::ProjectChecker.empty_templates
19
- end
20
-
21
- def template_path
22
- "#{Lono.config.output_path}/#{@blueprint}/templates/#{@template}.yml"
23
- end
24
- end
25
- end
@@ -1,41 +0,0 @@
1
- module Lono::AwsServices
2
- module Stack
3
- def stack_exists?(stack_name)
4
- return true if testing_update?
5
- return false if @options[:noop]
6
-
7
- exist = nil
8
- begin
9
- # When the stack does not exist an exception is raised. Example:
10
- # Aws::CloudFormation::Errors::ValidationError: Stack with id blah does not exist
11
- cfn.describe_stacks(stack_name: stack_name)
12
- exist = true
13
- rescue Aws::CloudFormation::Errors::ValidationError => e
14
- if e.message =~ /does not exist/
15
- exist = false
16
- elsif e.message.include?("'stackName' failed to satisfy constraint")
17
- # Example of e.message when describe_stack with invalid stack name
18
- # "1 validation error detected: Value 'instance_and_route53' at 'stackName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]*|arn:[-a-zA-Z0-9:/._+]*"
19
- puts "Invalid stack name: #{stack_name}"
20
- puts "Full error message: #{e.message}"
21
- exit 1
22
- else
23
- raise # re-raise exception because unsure what other errors can happen
24
- end
25
- end
26
- exist
27
- end
28
-
29
- def find_stack(stack_name)
30
- resp = cfn.describe_stacks(stack_name: stack_name)
31
- resp.stacks.first
32
- rescue Aws::CloudFormation::Errors::ValidationError => e
33
- # example: Stack with id demo-web does not exist
34
- if e.message =~ /Stack with/ && e.message =~ /does not exist/
35
- nil
36
- else
37
- raise
38
- end
39
- end
40
- end
41
- end
@@ -1,41 +0,0 @@
1
- module Lono::AwsServices
2
- module StackSet
3
- def stack_set_exists?(stack_set_name)
4
- return true if ENV['LONO_TEST']
5
- return false if @options[:noop]
6
-
7
- exist = nil
8
- begin
9
- # When the stack does not exist an exception is raised. Example:
10
- # Aws::CloudFormation::Errors::ValidationError: Stack with id blah does not exist
11
- cfn.describe_stack_set(stack_set_name: stack_set_name)
12
- exist = true
13
- rescue Aws::CloudFormation::Errors::StackSetNotFoundException => e
14
- if e.message =~ /not found/
15
- exist = false
16
- elsif e.message.include?("'stackName' failed to satisfy constraint")
17
- # Example of e.message when describe_stack with invalid stack name
18
- # "1 validation error detected: Value 'instance_and_route53' at 'stackName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]*|arn:[-a-zA-Z0-9:/._+]*"
19
- puts "Invalid stack name: #{stack_set_name}"
20
- puts "Full error message: #{e.message}"
21
- exit 1
22
- else
23
- raise # re-raise exception because unsure what other errors can happen
24
- end
25
- end
26
- exist
27
- end
28
-
29
- def find_stack_set(stack_set_name)
30
- resp = cfn.describe_set_stack(stack_set_name: stack_set_name)
31
- resp.stack_set
32
- rescue Aws::CloudFormation::Errors::ValidationError => e
33
- # example: StackSet with id demo-web does not exist
34
- if e.message =~ /Stack/ && e.message =~ /does not exist/
35
- nil
36
- else
37
- raise
38
- end
39
- end
40
- end
41
- end
@@ -1,7 +0,0 @@
1
- module Lono::Blueprint::Configset
2
- class Loader < Lono::Configset::Loader
3
- def finder_class
4
- Lono::Finder::Blueprint::Configset
5
- end
6
- end
7
- end
@@ -1,24 +0,0 @@
1
- class Lono::Blueprint
2
- module Helper
3
- extend Memoist
4
-
5
- def user_info
6
- git_author_name = git_installed? ? `git config user.name`.chomp : ""
7
- git_user_email = git_installed? ? `git config user.email`.chomp : ""
8
- github_username = git_installed? ? `git config github.user`.chomp : ""
9
-
10
- author = git_author_name.empty? ? "TODO: Write your name" : git_author_name
11
- email = git_user_email.empty? ? "TODO: Write your email address" : git_user_email
12
-
13
- author = "author" if ENV['LONO_TEST']
14
- email = "email" if ENV['LONO_TEST']
15
-
16
- {
17
- :author => author,
18
- :email => email,
19
- :github_username => github_username.empty? ? "[USERNAME]" : github_username,
20
- }
21
- end
22
- memoize :user_info
23
- end
24
- end
@@ -1,30 +0,0 @@
1
- require "yaml"
2
-
3
- class Lono::Blueprint
4
- class Meta
5
- extend Memoist
6
-
7
- def initialize(blueprint)
8
- @blueprint = blueprint
9
- end
10
-
11
- def jadespec
12
- Lono::Finder::Blueprint.find(@blueprint)
13
- end
14
- memoize :jadespec
15
-
16
- def auto_camelize?(target_section)
17
- auto_camelize = jadespec.auto_camelize
18
- # auto_camelize.nil? for backward compatibility
19
- return true if auto_camelize.nil? || auto_camelize == true
20
-
21
- if auto_camelize == "except_resource"
22
- return target_section != "resource"
23
- end
24
-
25
- if auto_camelize.is_a?(Array)
26
- auto_camelize.include?(target_section)
27
- end
28
- end
29
- end
30
- end
@@ -1,127 +0,0 @@
1
- class Lono::Blueprint
2
- class New < Lono::Sequence
3
- include Helper
4
- include Lono::Utils::Generators::Tree
5
-
6
- argument :blueprint_name
7
-
8
- def self.source_root
9
- templates = File.expand_path("../../templates", File.dirname(__FILE__))
10
- "#{templates}/blueprint"
11
- end
12
-
13
- def self.cli_options
14
- [
15
- [:bundle, type: :boolean, default: true, desc: "Runs bundle install on the project"],
16
- [:demo, type: :boolean, default: true, desc: "Include demo template"],
17
- [:force, type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files."],
18
- [:from_new, type: :boolean, desc: "Called from `lono new` command."],
19
- [:import, type: :boolean, desc: "Flag for lono code import"],
20
- [:project_name, default: '', desc: "Only used with from_new internally"],
21
- [:type, default: "dsl", desc: "Blueprint type: dsl or erb"],
22
- ]
23
- end
24
-
25
- cli_options.each do |args|
26
- class_option(*args)
27
- end
28
-
29
- # for specs
30
- def set_cwd
31
- @cwd = "#{Lono.root}/app/blueprints"
32
-
33
- if options[:from_new]
34
- # At this point @cwd will have the project_name from `lono new`
35
- # Yup, it's confusing. Here's an example to explain:
36
- #
37
- # lono new my-infra - sets @cwd = my-infra
38
- #
39
- # Then within the new Thor::Group this is called
40
- #
41
- # Lono::Blueprint::New.start(["ec2", "--from-new"])
42
- #
43
- # So @cwd = my-infra/blueprints
44
- @cwd = "#{options[:project_name]}/app/blueprints"
45
- end
46
- end
47
-
48
- def set_variables
49
- @demo = @options[:demo]
50
- @demo = false if ENV["LONO_ORG"] # overrides --demo CLI option
51
- end
52
-
53
- def create_project
54
- puts "=> Creating new blueprint called #{blueprint_name}."
55
- directory ".", "#{@cwd}/#{blueprint_name}", directory_options
56
- end
57
-
58
- def create_app_folder
59
- return if @options[:import]
60
-
61
- if @demo
62
- directory "../blueprint_types/#{@options[:type]}", "#{@cwd}/#{blueprint_name}"
63
- else
64
- empty_directory "#{@cwd}/#{blueprint_name}/app/templates"
65
- create_file "#{@cwd}/#{blueprint_name}/app/templates/#{blueprint_name}.rb"
66
- end
67
- end
68
-
69
- def create_empty_directories
70
- # Note: Not using Lono::Core::Config::PATHS.keys to create all of them because
71
- # think it is more common to not have all the folders. Instead create them explicitly.
72
- empty_directory "#{@cwd}/#{blueprint_name}/app/templates"
73
- end
74
-
75
- def create_license
76
- return unless ENV['LONO_LICENSE_FILE']
77
- copy_file ENV['LONO_LICENSE_FILE'], "#{@cwd}/#{blueprint_name}/LICENSE.txt"
78
- end
79
-
80
- def create_readme
81
- return unless ENV['LONO_README_FILE']
82
- template ENV['LONO_README_FILE'], "#{@cwd}/#{blueprint_name}/README.md"
83
- end
84
-
85
- # After this commands are executed with the newly created project
86
- def set_destination_root
87
- destination_root = "#{@cwd}/#{blueprint_name}"
88
- self.destination_root = destination_root
89
- @old_dir = Dir.pwd # for reset_current_dir
90
- FileUtils.cd(self.destination_root)
91
- end
92
-
93
- def welcome_message
94
- return if options[:from_new] || options[:import]
95
- puts <<~EOL
96
- #{"="*64}
97
- Congrats 🎉 You have successfully created a lono blueprint.
98
-
99
- Cd into your blueprint and check things out.
100
-
101
- cd #{blueprint_name}
102
-
103
- More info: https://lono.cloud/docs/core/blueprints
104
-
105
- EOL
106
- end
107
-
108
- def tree
109
- tree_structure("blueprint")
110
- end
111
-
112
- # Reason: So `lono code import` prints out the params values with relative paths
113
- # when the config files are generated.
114
- def reset_current_dir
115
- FileUtils.cd(@old_dir)
116
- end
117
-
118
- private
119
- def directory_options
120
- if ENV['LONO_README_FILE']
121
- {exclude_pattern: /README/}
122
- else
123
- {}
124
- end
125
- end
126
- end
127
- end
@@ -1,25 +0,0 @@
1
- require "bundler"
2
-
3
- class Lono::Blueprint
4
- module Root
5
- # Switch the lono root
6
- def set_blueprint_root(blueprint)
7
- blueprint_root = find_blueprint_root(blueprint)
8
- if blueprint_root
9
- Lono.blueprint_root = blueprint_root
10
- else
11
- puts <<~EOL.color(:red)
12
- ERROR: Unable to find the blueprint #{blueprint.inspect}.
13
- Are you sure its in your Gemfile or in the blueprints folder with the correct name?
14
- EOL
15
- Lono::Finder::Blueprint.list
16
- ENV['LONO_TEST'] ? raise("Unable to find blueprint: #{blueprint.inspect}") : exit(1)
17
- end
18
- end
19
-
20
- def find_blueprint_root(blueprint)
21
- config = Lono::Finder::Blueprint.find(blueprint) # blueprint_root
22
- config.root if config
23
- end
24
- end
25
- end
@@ -1,41 +0,0 @@
1
- require "yaml"
2
-
3
- class Lono::Cfn
4
- class Create < Base
5
- # save is the interface method
6
- # aws cloudformation create-stack --stack-name prod-hi-123456789 --parameters file://output/params/prod-hi-123456789.json --template-body file://output/prod-hi.json
7
- def save(parameters)
8
- message = "Creating #{@stack.color(:green)} stack."
9
- if @options[:noop]
10
- puts "NOOP #{message}"
11
- return
12
- end
13
-
14
- delete_rollback_stack
15
-
16
- if stack_exists?(@stack)
17
- puts "Cannot create #{@stack.color(:green)} stack because it already exists.".color(:red)
18
- return
19
- end
20
-
21
- unless File.exist?(template_path)
22
- puts "Cannot create #{@stack.color(:green)} template not found: #{template_path}."
23
- return
24
- end
25
-
26
- options = {
27
- capabilities: capabilities, # ["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM"]
28
- disable_rollback: !@options[:rollback],
29
- parameters: parameters,
30
- stack_name: @stack,
31
- }
32
- options[:notification_arns] = notification_arns if notification_arns
33
- options[:tags] = tags unless tags.empty?
34
- set_template_url!(options)
35
-
36
- show_options(options, "cfn.create_stack")
37
- cfn.create_stack(options) # TODO: COMMENT OUT FOR TESTING
38
- puts message unless @options[:mute]
39
- end
40
- end
41
- end
data/lib/lono/cfn/opts.rb DELETED
@@ -1,88 +0,0 @@
1
- class Lono::Cfn
2
- class Opts < Lono::Opts
3
- def create
4
- notification_arns_option
5
- base_options
6
- wait_options
7
- end
8
-
9
- def update
10
- notification_arns_option
11
- base_options
12
- update_options
13
- wait_options
14
- end
15
-
16
- def deploy
17
- update
18
- end
19
-
20
- def delete
21
- wait_options
22
- end
23
-
24
- def cancel
25
- wait_options
26
- end
27
-
28
- def preview
29
- base_options
30
- update_options
31
- with_cli_scope do
32
- option :keep, type: :boolean, desc: "keep the changeset instead of deleting it afterwards"
33
- end
34
- end
35
-
36
- def download
37
- base_options
38
- with_cli_scope do
39
- option :name, desc: "Name you want to save the template as. Default: existing stack name."
40
- option :source, desc: "url or path to file with template"
41
- end
42
- end
43
-
44
- # Lono::Cfn and Lono::Sets
45
- def base_options(rollback: true)
46
- with_cli_scope do
47
- if rollback
48
- option :rollback, type: :boolean, desc: "rollback", default: true
49
- end
50
- # common to Lono::Cfn and Lono::Sets
51
- option :source, desc: "url or path to file with template"
52
- option :blueprint, desc: "override convention and specify the template file to use"
53
- option :capabilities, type: :array, desc: "iam capabilities. Ex: CAPABILITY_IAM, CAPABILITY_NAMED_IAM"
54
- option :config, aliases: "c", desc: "override convention and specify both the param and variable file to use"
55
- option :iam, type: :boolean, desc: "Shortcut for common IAM capabilities: CAPABILITY_IAM, CAPABILITY_NAMED_IAM"
56
- option :param, aliases: "p", desc: "override convention and specify the param file to use"
57
- option :tags, type: :hash, desc: "Tags for the stack. IE: Name:api-web Owner:bob"
58
- option :template, desc: "override convention and specify the template file to use"
59
- option :variable, aliases: "v", desc: "override convention and specify the variable file to use"
60
- end
61
- end
62
-
63
- def wait_options
64
- with_cli_scope do
65
- option :wait, type: :boolean, desc: "Wait for stack operation to complete.", default: true
66
- option :sure, type: :boolean, desc: "Skip are you sure prompt" # moved to base but used by commands like `lono cfn delete` also. Just keep here.
67
- end
68
- end
69
-
70
- def update_options(change_set: true)
71
- with_cli_scope do
72
- if change_set
73
- option :change_set, type: :boolean, default: true, desc: "Uses generated change set to update the stack. If false, will perform normal update-stack."
74
- option :changeset_preview, type: :boolean, default: true, desc: "Show ChangeSet changes preview."
75
- end
76
- # common to Lono::Cfn and Lono::Sets
77
- option :codediff_preview, type: :boolean, default: true, desc: "Show codediff changes preview."
78
- option :param_preview, type: :boolean, default: true, desc: "Show parameter diff preview."
79
- end
80
- end
81
-
82
- def notification_arns_option
83
- with_cli_scope do
84
- option :notification_arns, type: :array, desc: "The Simple Notification Service (SNS) topic ARNs to publish stack related events."
85
- end
86
- end
87
- end
88
- end