lono 7.4.11 → 8.0.0.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.cody/README.md +5 -15
- data/.cody/acceptance/bin/build.sh +52 -0
- data/.cody/acceptance/buildspec.yml +10 -0
- data/.cody/acceptance/project.rb +6 -0
- data/.cody/{role.rb → acceptance/role.rb} +0 -0
- data/.cody/shared/script/install/lono.sh +40 -0
- data/.cody/shared/script/install.sh +5 -0
- data/CHANGELOG.md +33 -5
- data/CONTRIBUTING.md +2 -2
- data/Gemfile +5 -1
- data/LICENSE.txt +201 -1
- data/README.md +6 -5
- data/lib/lono/api/client.rb +3 -2
- data/lib/lono/app/inits.rb +13 -0
- data/lib/lono/app.rb +71 -0
- data/lib/lono/app_file/base.rb +1 -1
- data/lib/lono/app_file/build/lambda_layer/ruby_packager.rb +9 -9
- data/lib/lono/app_file/build/lambda_layer.rb +3 -3
- data/lib/lono/app_file/build.rb +9 -14
- data/lib/lono/app_file/registry/item.rb +4 -4
- data/lib/lono/app_file/upload.rb +1 -1
- data/lib/lono/autoloader.rb +2 -2
- data/lib/lono/aws_services/helper.rb +43 -6
- data/lib/lono/aws_services.rb +37 -6
- data/lib/lono/blueprint.rb +18 -9
- data/lib/lono/booter.rb +28 -0
- data/lib/lono/{template → builder}/context/helpers.rb +1 -1
- data/lib/lono/{template → builder}/context/loader/load_files.rb +5 -6
- data/lib/lono/builder/context/loader.rb +35 -0
- data/lib/lono/builder/context/params.rb +7 -0
- data/lib/lono/{template → builder}/context/ssm_fetcher.rb +1 -1
- data/lib/lono/{template → builder}/context.rb +5 -9
- data/lib/lono/{param/generator.rb → builder/param.rb} +21 -22
- data/lib/lono/builder/template/aws_service.rb +15 -0
- data/lib/lono/builder/template/bashify.rb +43 -0
- data/lib/lono/{template → builder/template}/configset_injector.rb +4 -4
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/fn.rb +2 -2
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers/core_helper.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers/ec2_helper.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers/file_helper.rb +8 -12
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers/s3_helper.rb +2 -2
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers/stack_helper.rb +11 -8
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers/tags_helper.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/helpers.rb +2 -2
- data/lib/lono/builder/template/dsl/evaluator/section/base.rb +23 -0
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/condition.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/mapping.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/methods.rb +7 -7
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/output.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/parameter.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/resource/property_mover.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/resource.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/section/section.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/squeezer.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/stringify.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/syntax/extend_with.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/syntax/parameter_group.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder → builder/template/dsl/evaluator}/syntax.rb +3 -3
- data/lib/lono/builder/template/dsl/evaluator.rb +45 -0
- data/lib/lono/{template/strategy → builder/template}/dsl/finalizer/parameter_groups.rb +2 -2
- data/lib/lono/{template/strategy → builder/template}/dsl/finalizer.rb +1 -1
- data/lib/lono/builder/template/dsl.rb +14 -0
- data/lib/lono/{template → builder/template}/evaluate.rb +18 -6
- data/lib/lono/builder/template/helpers.rb +149 -0
- data/lib/lono/{output/template.rb → builder/template/output.rb} +14 -7
- data/lib/lono/{template → builder/template}/post_processor.rb +4 -4
- data/lib/lono/{template → builder/template}/upload.rb +3 -5
- data/lib/lono/builder/template.rb +55 -0
- data/lib/lono/bundler/cli/base.rb +10 -0
- data/lib/lono/bundler/cli/bundle.rb +44 -0
- data/lib/lono/bundler/cli/clean.rb +27 -0
- data/lib/lono/bundler/cli/help/bundle.md +3 -0
- data/lib/lono/bundler/cli/help.rb +11 -0
- data/lib/lono/bundler/cli.rb +7 -0
- data/lib/lono/bundler/component/concerns/local_concern.rb +10 -0
- data/lib/lono/bundler/component/concerns/notation_concern.rb +59 -0
- data/lib/lono/bundler/component/concerns/path_concern.rb +68 -0
- data/lib/lono/bundler/component/concerns/stack_concern.rb +60 -0
- data/lib/lono/bundler/component/fetcher/base.rb +27 -0
- data/lib/lono/bundler/component/fetcher/gcs.rb +69 -0
- data/lib/lono/bundler/component/fetcher/git.rb +69 -0
- data/lib/lono/bundler/component/fetcher/local.rb +15 -0
- data/lib/lono/bundler/component/fetcher/s3.rb +66 -0
- data/lib/lono/bundler/component/fetcher.rb +18 -0
- data/lib/lono/bundler/component/http/concern.rb +45 -0
- data/lib/lono/bundler/component/http/source.rb +19 -0
- data/lib/lono/bundler/component/org_repo.rb +65 -0
- data/lib/lono/bundler/component/props/extension.rb +19 -0
- data/lib/lono/bundler/component/props/typer.rb +41 -0
- data/lib/lono/bundler/component/props.rb +122 -0
- data/lib/lono/bundler/component/registry.rb +136 -0
- data/lib/lono/bundler/component.rb +52 -0
- data/lib/lono/bundler/config.rb +18 -0
- data/lib/lono/bundler/dsl/syntax.rb +46 -0
- data/lib/lono/bundler/dsl.rb +21 -0
- data/lib/lono/bundler/exporter/base.rb +6 -0
- data/lib/lono/bundler/exporter/copy.rb +22 -0
- data/lib/lono/bundler/exporter.rb +50 -0
- data/lib/lono/bundler/extract/tar.rb +34 -0
- data/lib/lono/bundler/extract/zip.rb +16 -0
- data/lib/lono/bundler/info.rb +39 -0
- data/lib/lono/bundler/list.rb +26 -0
- data/lib/lono/bundler/lockfile/version_comparer.rb +56 -0
- data/lib/lono/bundler/lockfile/yamler.rb +36 -0
- data/lib/lono/bundler/lockfile.rb +66 -0
- data/lib/lono/bundler/lonofile.rb +32 -0
- data/lib/lono/bundler/runner.rb +27 -0
- data/lib/lono/bundler/syncer.rb +70 -0
- data/lib/lono/bundler/util/git.rb +37 -0
- data/lib/lono/bundler/util/logging.rb +7 -0
- data/lib/lono/bundler/util/sure.rb +5 -0
- data/lib/lono/{bundle.rb → bundler.rb} +38 -4
- data/lib/lono/cfn/base.rb +9 -196
- data/lib/lono/cfn/cancel.rb +9 -26
- data/lib/lono/cfn/concerns/build.rb +10 -0
- data/lib/lono/cfn/concerns/template_output.rb +10 -0
- data/lib/lono/cfn/concerns.rb +43 -0
- data/lib/lono/cfn/delete.rb +8 -32
- data/lib/lono/cfn/deploy/base.rb +4 -0
- data/lib/lono/cfn/deploy/iam.rb +49 -0
- data/lib/lono/cfn/deploy/notification.rb +8 -0
- data/lib/lono/cfn/deploy/operable.rb +18 -0
- data/lib/lono/cfn/deploy/opts.rb +49 -0
- data/lib/lono/cfn/deploy/rollback.rb +46 -0
- data/lib/lono/cfn/deploy/tags.rb +18 -0
- data/lib/lono/cfn/deploy.rb +71 -5
- data/lib/lono/cfn/download.rb +5 -7
- data/lib/lono/cfn/output.rb +49 -0
- data/lib/lono/cfn/plan/base.rb +19 -0
- data/lib/lono/cfn/plan/changeset/base.rb +19 -0
- data/lib/lono/cfn/plan/changeset/notifications.rb +24 -0
- data/lib/lono/cfn/plan/changeset/outputs.rb +25 -0
- data/lib/lono/cfn/plan/changeset/resources.rb +48 -0
- data/lib/lono/cfn/plan/changeset/tags.rb +16 -0
- data/lib/lono/cfn/plan/changeset.rb +136 -0
- data/lib/lono/cfn/plan/concerns.rb +10 -0
- data/lib/lono/cfn/plan/delete.rb +16 -0
- data/lib/lono/cfn/plan/diff/base.rb +10 -0
- data/lib/lono/cfn/plan/diff/data.rb +52 -0
- data/lib/lono/cfn/plan/diff/file.rb +56 -0
- data/lib/lono/cfn/plan/new.rb +26 -0
- data/lib/lono/cfn/{preview → plan}/param.rb +26 -34
- data/lib/lono/cfn/plan/summary.rb +16 -0
- data/lib/lono/cfn/plan/template.rb +28 -0
- data/lib/lono/cfn/plan.rb +33 -0
- data/lib/lono/cfn/show.rb +30 -0
- data/lib/lono/cfn/status.rb +1 -1
- data/lib/lono/cli/abstract.rb +17 -0
- data/lib/lono/cli/base.rb +9 -0
- data/lib/lono/cli/build.rb +101 -0
- data/lib/lono/cli/bundle.rb +21 -0
- data/lib/lono/cli/cfn/opts.rb +59 -0
- data/lib/lono/cli/cfn.rb +19 -0
- data/lib/lono/cli/clean.rb +22 -0
- data/lib/lono/{code.rb → cli/code.rb} +2 -2
- data/lib/lono/{completion.rb → cli/completion.rb} +2 -2
- data/lib/lono/{help → cli/help}/blueprint/new.md +4 -4
- data/lib/lono/{help/generate.md → cli/help/build.md} +6 -6
- data/lib/lono/{help → cli/help}/cfn/cancel.md +0 -0
- data/lib/lono/cli/help/cfn/download.md +3 -0
- data/lib/lono/{help → cli/help}/cfn/preview.md +9 -8
- data/lib/lono/{help → cli/help}/cfn/status.md +0 -0
- data/lib/lono/cli/help/cfn.md +4 -0
- data/lib/lono/{help → cli/help}/code/convert.md +0 -0
- data/lib/lono/{help → cli/help}/code/import.md +2 -2
- data/lib/lono/{help → cli/help}/completion.md +3 -3
- data/lib/lono/{help → cli/help}/completion_script.md +0 -0
- data/lib/lono/{help → cli/help}/configsets.md +0 -0
- data/lib/lono/cli/help/down.md +13 -0
- data/lib/lono/cli/help/new/project.md +34 -0
- data/lib/lono/{help → cli/help}/param/generate.md +0 -0
- data/lib/lono/cli/help/param.md +6 -0
- data/lib/lono/{help → cli/help}/pro/blueprints.md +0 -0
- data/lib/lono/{help → cli/help}/pro/configsets.md +0 -0
- data/lib/lono/{help → cli/help}/script/build.md +0 -0
- data/lib/lono/{help → cli/help}/script/upload.md +0 -0
- data/lib/lono/{help → cli/help}/seed.md +2 -2
- data/lib/lono/cli/help/summary.md +33 -0
- data/lib/lono/{help → cli/help}/template/bashify.md +0 -0
- data/lib/lono/cli/help/template/generate.md +7 -0
- data/lib/lono/{help → cli/help}/template.md +0 -0
- data/lib/lono/cli/help/up.md +30 -0
- data/lib/lono/{help → cli/help}/user_data.md +3 -3
- data/lib/lono/cli/help.rb +56 -0
- data/lib/lono/cli/list.rb +28 -0
- data/lib/lono/cli/new/blueprint.rb +33 -0
- data/lib/lono/cli/new/concerns.rb +16 -0
- data/lib/lono/{configset/new.rb → cli/new/configset.rb} +2 -9
- data/lib/lono/{extension/new.rb → cli/new/extension.rb} +2 -10
- data/lib/lono/cli/new/helper.rb +32 -0
- data/lib/lono/cli/new/project.rb +77 -0
- data/lib/lono/cli/new/sequence.rb +51 -0
- data/lib/lono/cli/new/shim.rb +59 -0
- data/lib/lono/cli/new/test/blueprint.rb +23 -0
- data/lib/lono/cli/new/test/sequence.rb +10 -0
- data/lib/lono/cli/new/test.rb +8 -0
- data/lib/lono/cli/new.rb +31 -0
- data/lib/lono/{opts.rb → cli/opts.rb} +9 -12
- data/lib/lono/{s3.rb → cli/s3.rb} +9 -7
- data/lib/lono/cli/script/base.rb +5 -0
- data/lib/lono/cli/script/build.rb +72 -0
- data/lib/lono/cli/script/upload.rb +49 -0
- data/lib/lono/{script.rb → cli/script.rb} +2 -2
- data/lib/lono/cli/seed.rb +9 -0
- data/lib/lono/cli/test.rb +35 -0
- data/lib/lono/cli.rb +80 -106
- data/lib/lono/command.rb +27 -0
- data/lib/lono/configset/{generator.rb → builder.rb} +9 -7
- data/lib/lono/configset/combiner.rb +8 -6
- data/lib/lono/configset/evaluate_file.rb +1 -1
- data/lib/lono/configset/meta.rb +1 -1
- data/lib/lono/configset/s3_file/build.rb +5 -4
- data/lib/lono/configset/s3_file/item.rb +1 -1
- data/lib/lono/configset/s3_file/upload.rb +2 -2
- data/lib/lono/configset/strategy/base.rb +6 -6
- data/lib/lono/configset/strategy/helpers/dsl/core.rb +1 -1
- data/lib/lono/core.rb +25 -54
- data/lib/lono/extensions/dsl.rb +2 -5
- data/lib/lono/extensions/loader.rb +1 -12
- data/lib/lono/extensions.rb +2 -2
- data/lib/lono/importer/base.rb +5 -5
- data/lib/lono/importer/download.rb +7 -7
- data/lib/lono/importer/dsl.rb +3 -3
- data/lib/lono/importer/service/coder.rb +10 -10
- data/lib/lono/importer.rb +1 -10
- data/lib/lono/inspector/base.rb +7 -7
- data/lib/lono/inspector/summary.rb +19 -17
- data/lib/lono/layering/layer.rb +126 -0
- data/lib/lono/layering.rb +13 -55
- data/lib/lono/logger/formatter.rb +13 -0
- data/lib/lono/logger.rb +33 -0
- data/lib/lono/lookup.rb +12 -0
- data/lib/lono/names.rb +50 -0
- data/lib/lono/plugin/meta.rb +30 -0
- data/lib/lono/plugin/tester.rb +13 -0
- data/lib/lono/plugin.rb +10 -0
- data/lib/lono/s3/aws_setup.rb +4 -3
- data/lib/lono/s3/bucket.rb +19 -19
- data/lib/lono/s3/uploader.rb +10 -12
- data/lib/lono/script/base.rb +3 -3
- data/lib/lono/script/build.rb +11 -12
- data/lib/lono/script/upload.rb +7 -7
- data/lib/lono/{seed → seeder}/service_role.rb +1 -1
- data/lib/lono/{seed/base.rb → seeder.rb} +21 -36
- data/lib/lono/user_data.rb +8 -13
- data/lib/lono/utils/context.rb +15 -0
- data/lib/lono/utils/item/zip.rb +5 -5
- data/lib/lono/utils/logging.rb +7 -0
- data/lib/lono/utils/{pretty_time.rb → pretty.rb} +6 -2
- data/lib/lono/utils/quit.rb +7 -0
- data/lib/lono/utils/rsync.rb +4 -2
- data/lib/lono/utils/sure.rb +4 -4
- data/lib/lono/version.rb +1 -1
- data/lib/lono.rb +7 -11
- data/lib/templates/blueprint/template.rb +2 -0
- data/lib/templates/configset/{lib/configset.rb → configset.rb} +0 -0
- data/lib/templates/examples/blueprint/template.rb +9 -0
- data/lib/templates/helper/%underscore_name%_helper.rb.tt +6 -0
- data/lib/templates/{skeleton → project}/.gitignore +1 -2
- data/lib/templates/project/Gemfile.tt +11 -0
- data/lib/templates/project/README.md +9 -0
- data/lib/templates/project/config/app.rb +3 -0
- data/lib/templates/shim/lono +7 -0
- data/lono.gemspec +51 -43
- metadata +261 -264
- data/.circleci/README.md +0 -3
- data/.circleci/config.yml +0 -58
- data/.cody/acceptance.sh +0 -49
- data/.cody/buildspec.yml +0 -9
- data/.cody/demo.rb +0 -38
- data/.cody/project.rb +0 -6
- data/.gitmodules +0 -3
- data/lib/lono/abstract_base.rb +0 -25
- data/lib/lono/aws_services/stack.rb +0 -41
- data/lib/lono/aws_services/stack_set.rb +0 -41
- data/lib/lono/blueprint/configset/loader.rb +0 -7
- data/lib/lono/blueprint/helper.rb +0 -24
- data/lib/lono/blueprint/meta.rb +0 -30
- data/lib/lono/blueprint/new.rb +0 -127
- data/lib/lono/blueprint/root.rb +0 -25
- data/lib/lono/cfn/create.rb +0 -41
- data/lib/lono/cfn/opts.rb +0 -88
- data/lib/lono/cfn/preview/changeset.rb +0 -168
- data/lib/lono/cfn/preview/codediff.rb +0 -41
- data/lib/lono/cfn/preview/diff_viewer.rb +0 -23
- data/lib/lono/cfn/rollback.rb +0 -26
- data/lib/lono/cfn/update.rb +0 -71
- data/lib/lono/cfn.rb +0 -75
- data/lib/lono/clean.rb +0 -14
- data/lib/lono/configset/list.rb +0 -67
- data/lib/lono/configset/preparer.rb +0 -44
- data/lib/lono/configset/register/base.rb +0 -122
- data/lib/lono/configset/register/blueprint.rb +0 -16
- data/lib/lono/configset/register/dsl.rb +0 -14
- data/lib/lono/configset/register/project.rb +0 -13
- data/lib/lono/configset/resolver.rb +0 -47
- data/lib/lono/configset.rb +0 -16
- data/lib/lono/conventions.rb +0 -23
- data/lib/lono/core/config.rb +0 -22
- data/lib/lono/default/settings.yml +0 -21
- data/lib/lono/ext/bundler.rb +0 -7
- data/lib/lono/extension/helper.rb +0 -13
- data/lib/lono/extension/list.rb +0 -40
- data/lib/lono/extension.rb +0 -9
- data/lib/lono/extensions/preparer.rb +0 -26
- data/lib/lono/extensions/register.rb +0 -15
- data/lib/lono/file_uploader.rb +0 -21
- data/lib/lono/finder/base.rb +0 -152
- data/lib/lono/finder/blueprint/configset.rb +0 -17
- data/lib/lono/finder/blueprint.rb +0 -11
- data/lib/lono/finder/configset.rb +0 -11
- data/lib/lono/finder/extension.rb +0 -11
- data/lib/lono/generate.rb +0 -107
- data/lib/lono/help/cfn/create.md +0 -26
- data/lib/lono/help/cfn/delete.md +0 -13
- data/lib/lono/help/cfn/deploy.md +0 -21
- data/lib/lono/help/cfn/download.md +0 -3
- data/lib/lono/help/cfn/update.md +0 -49
- data/lib/lono/help/cfn.md +0 -7
- data/lib/lono/help/new.md +0 -57
- data/lib/lono/help/param.md +0 -6
- data/lib/lono/help/sets/delete.md +0 -8
- data/lib/lono/help/sets/deploy.md +0 -76
- data/lib/lono/help/sets/instances/delete.md +0 -21
- data/lib/lono/help/sets/instances/list.md +0 -14
- data/lib/lono/help/sets/instances/status.md +0 -15
- data/lib/lono/help/sets/instances/sync.md +0 -90
- data/lib/lono/help/sets/status.md +0 -23
- data/lib/lono/help/summary.md +0 -33
- data/lib/lono/help/template/generate.md +0 -7
- data/lib/lono/help/upgrade.md +0 -1
- data/lib/lono/help/xgraph.md +0 -16
- data/lib/lono/help.rb +0 -15
- data/lib/lono/importer/erb.rb +0 -31
- data/lib/lono/inspector/graph.rb +0 -125
- data/lib/lono/jade/circular.rb +0 -26
- data/lib/lono/jade/materializer/final.rb +0 -10
- data/lib/lono/jade/materializer/gems_builder.rb +0 -81
- data/lib/lono/jade/materializer/source.rb +0 -54
- data/lib/lono/jade/materializer.rb +0 -15
- data/lib/lono/jade/registry.rb +0 -64
- data/lib/lono/jade.rb +0 -110
- data/lib/lono/jadespec.rb +0 -68
- data/lib/lono/new/helper.rb +0 -15
- data/lib/lono/new.rb +0 -95
- data/lib/lono/param.rb +0 -14
- data/lib/lono/pro/base.rb +0 -16
- data/lib/lono/pro/repo.rb +0 -28
- data/lib/lono/pro.rb +0 -15
- data/lib/lono/project_checker.rb +0 -35
- data/lib/lono/registration/base.rb +0 -37
- data/lib/lono/registration/check.rb +0 -15
- data/lib/lono/registration/temp.rb +0 -53
- data/lib/lono/registration/user.rb +0 -60
- data/lib/lono/seed.rb +0 -39
- data/lib/lono/sequence.rb +0 -35
- data/lib/lono/sets/base.rb +0 -50
- data/lib/lono/sets/create.rb +0 -30
- data/lib/lono/sets/delete.rb +0 -52
- data/lib/lono/sets/deploy.rb +0 -11
- data/lib/lono/sets/instances/base.rb +0 -30
- data/lib/lono/sets/instances/delete.rb +0 -69
- data/lib/lono/sets/instances/list.rb +0 -13
- data/lib/lono/sets/instances/opts.rb +0 -29
- data/lib/lono/sets/instances/status.rb +0 -12
- data/lib/lono/sets/instances/sync.rb +0 -180
- data/lib/lono/sets/instances.rb +0 -33
- data/lib/lono/sets/list.rb +0 -35
- data/lib/lono/sets/opts.rb +0 -18
- data/lib/lono/sets/preview/codediff.rb +0 -35
- data/lib/lono/sets/preview/param.rb +0 -32
- data/lib/lono/sets/status/instance/base.rb +0 -120
- data/lib/lono/sets/status/instance/completed.rb +0 -35
- data/lib/lono/sets/status/instance/deleted.rb +0 -32
- data/lib/lono/sets/status/instance/show.rb +0 -7
- data/lib/lono/sets/status/instance.rb +0 -20
- data/lib/lono/sets/status/instances.rb +0 -133
- data/lib/lono/sets/status.rb +0 -116
- data/lib/lono/sets/summarize.rb +0 -20
- data/lib/lono/sets/time_spent.rb +0 -11
- data/lib/lono/sets/update.rb +0 -81
- data/lib/lono/sets.rb +0 -38
- data/lib/lono/setting.rb +0 -75
- data/lib/lono/template/aws_service.rb +0 -20
- data/lib/lono/template/bashify.rb +0 -39
- data/lib/lono/template/context/loader.rb +0 -52
- data/lib/lono/template/generator.rb +0 -23
- data/lib/lono/template/helper.rb +0 -152
- data/lib/lono/template/strategy/base.rb +0 -4
- data/lib/lono/template/strategy/common/helpers.rb +0 -44
- data/lib/lono/template/strategy/dsl/builder/section/base.rb +0 -30
- data/lib/lono/template/strategy/dsl/builder.rb +0 -59
- data/lib/lono/template/strategy/dsl.rb +0 -14
- data/lib/lono/template/strategy/erb.rb +0 -82
- data/lib/lono/template/strategy/source.rb +0 -8
- data/lib/lono/template/template.rb +0 -54
- data/lib/lono/template/util.rb +0 -8
- data/lib/lono/template.rb +0 -24
- data/lib/lono/upgrade.rb +0 -20
- data/lib/lono/utils/generators/tree.rb +0 -18
- data/lib/templates/blueprint/%blueprint_name%.gemspec.tt +0 -45
- data/lib/templates/blueprint/.gitignore +0 -11
- data/lib/templates/blueprint/CHANGELOG.md +0 -7
- data/lib/templates/blueprint/Gemfile +0 -4
- data/lib/templates/blueprint/README.md.tt +0 -33
- data/lib/templates/blueprint/Rakefile.tt +0 -9
- data/lib/templates/blueprint/seed/configs.rb +0 -28
- data/lib/templates/blueprint_types/dsl/app/templates/%blueprint_name%.rb +0 -36
- data/lib/templates/blueprint_types/dsl/app/user_data/bootstrap.sh +0 -2
- data/lib/templates/blueprint_types/erb/app/definitions/base.rb.tt +0 -1
- data/lib/templates/blueprint_types/erb/app/templates/%blueprint_name%.yml +0 -67
- data/lib/templates/configset/%configset_name%.gemspec.tt +0 -42
- data/lib/templates/configset/.gitignore +0 -10
- data/lib/templates/configset/CHANGELOG.md +0 -7
- data/lib/templates/configset/Gemfile +0 -4
- data/lib/templates/configset/README.md.tt +0 -3
- data/lib/templates/configset/Rakefile.tt +0 -9
- data/lib/templates/extension/%extension_name%.gemspec.tt +0 -46
- data/lib/templates/extension/.gitignore +0 -11
- data/lib/templates/extension/.rspec +0 -3
- data/lib/templates/extension/CHANGELOG.md +0 -7
- data/lib/templates/extension/Gemfile.tt +0 -4
- data/lib/templates/extension/Rakefile.tt +0 -9
- data/lib/templates/extension/spec/spec_helper.rb.tt +0 -29
- data/lib/templates/skeleton/Gemfile +0 -3
- data/lib/templates/skeleton/README.md +0 -58
- data/lib/templates/skeleton/configs/settings.yml +0 -13
- data/vendor/cfn-status/CHANGELOG.md +0 -14
- data/vendor/cfn-status/Gemfile +0 -4
- data/vendor/cfn-status/Gemfile.lock +0 -49
- data/vendor/cfn-status/LICENSE.txt +0 -21
- data/vendor/cfn-status/README.md +0 -58
- data/vendor/cfn-status/Rakefile +0 -6
- data/vendor/cfn-status/bin/console +0 -14
- data/vendor/cfn-status/bin/setup +0 -8
- data/vendor/cfn-status/cfn-status.gemspec +0 -30
- data/vendor/cfn-status/lib/cfn-status.rb +0 -1
- data/vendor/cfn-status/lib/cfn_status/aws_service.rb +0 -51
- data/vendor/cfn-status/lib/cfn_status/version.rb +0 -3
- data/vendor/cfn-status/lib/cfn_status.rb +0 -245
- data/vendor/cfn-status/spec/fixtures/cfn/pages/fresh/describe_stack_events-1.json +0 -1103
- data/vendor/cfn-status/spec/fixtures/cfn/pages/fresh/describe_stack_events-2.json +0 -1104
- data/vendor/cfn-status/spec/fixtures/cfn/pages/fresh/describe_stack_events-3.json +0 -1103
- data/vendor/cfn-status/spec/fixtures/cfn/pages/updating/describe_stack_events-1.json +0 -1103
- data/vendor/cfn-status/spec/fixtures/cfn/pages/updating/describe_stack_events-2.json +0 -1104
- data/vendor/cfn-status/spec/fixtures/cfn/pages/updating/describe_stack_events-3.json +0 -1103
- data/vendor/cfn-status/spec/fixtures/cfn/stack-events-complete.json +0 -1080
- data/vendor/cfn-status/spec/fixtures/cfn/stack-events-in-progress.json +0 -1080
- data/vendor/cfn-status/spec/fixtures/cfn/stack-events-update-rollback-complete.json +0 -1086
- data/vendor/cfn-status/spec/lib/cfn_status_spec.rb +0 -153
- data/vendor/cfn-status/spec/spec_helper.rb +0 -14
@@ -0,0 +1,35 @@
|
|
1
|
+
class Lono::CLI
|
2
|
+
class Test
|
3
|
+
def initialize(options={})
|
4
|
+
@options = options
|
5
|
+
end
|
6
|
+
|
7
|
+
def run
|
8
|
+
config = Lono.config
|
9
|
+
test_command = config.test.framework
|
10
|
+
execute(test_command)
|
11
|
+
end
|
12
|
+
|
13
|
+
def execute(command)
|
14
|
+
command = adjust_command(command)
|
15
|
+
puts "=> #{command}"
|
16
|
+
Kernel.exec(command)
|
17
|
+
end
|
18
|
+
|
19
|
+
def adjust_command(command)
|
20
|
+
if cd_into_test?
|
21
|
+
command = "bundle exec #{command}" unless command.include?("bundle exec")
|
22
|
+
command = "cd test && #{command}"
|
23
|
+
else
|
24
|
+
command
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# Automatically cd into the test folder in case running within the root of a module.
|
29
|
+
# Detect/guess that we're in a module folder vs the lono project
|
30
|
+
def cd_into_test?
|
31
|
+
!File.exist?("app") && File.exist?("test") &&
|
32
|
+
(File.exist?("template.rb") || File.exist?("template"))
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/lono/cli.rb
CHANGED
@@ -1,116 +1,118 @@
|
|
1
1
|
module Lono
|
2
2
|
class CLI < Command
|
3
|
+
include Help
|
3
4
|
include Thor::Actions # for add_runtime_options
|
4
5
|
opts = Opts.new(self)
|
6
|
+
cfn_opts = Lono::CLI::Cfn::Opts.new(self)
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
8
|
+
desc "build BLUEPRINT", "Build both CloudFormation template and parameters files"
|
9
|
+
long_desc Help.text(:build)
|
10
|
+
option :quiet, type: :boolean, desc: "silence the output"
|
11
|
+
opts.clean
|
12
|
+
def build(blueprint)
|
13
|
+
Build.new(options.merge(blueprint: blueprint, build_only: true)).all
|
9
14
|
end
|
10
|
-
register(New, "new", "new NAME", "Generates new lono project.")
|
11
15
|
|
12
|
-
desc "
|
13
|
-
long_desc Help.text(:
|
14
|
-
def
|
15
|
-
|
16
|
-
Lono::Registration.check
|
16
|
+
desc "bundle", "Bundle with Lonofile."
|
17
|
+
long_desc Help.text(:bundle)
|
18
|
+
def bundle(*args)
|
19
|
+
Bundle.new(options.merge(args: args)).run
|
17
20
|
end
|
18
21
|
|
19
|
-
desc "
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
def configsets(blueprint=nil)
|
24
|
-
Configset::List.new(options.merge(blueprint: blueprint)).run
|
22
|
+
desc "clean", "Removes `output` folder."
|
23
|
+
opts.yes
|
24
|
+
def clean
|
25
|
+
Clean.new(options).run
|
25
26
|
end
|
26
27
|
|
27
|
-
desc "
|
28
|
-
long_desc Help.text(:
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
Extension::List.new(options.merge(blueprint: blueprint)).run
|
28
|
+
desc "down BLUEPRINT", "Delete CloudFormation blueprint"
|
29
|
+
long_desc Help.text(:down)
|
30
|
+
cfn_opts.delete
|
31
|
+
def down(blueprint)
|
32
|
+
Lono::Cfn::Delete.new(options.merge(blueprint: blueprint)).run
|
33
33
|
end
|
34
34
|
|
35
|
-
desc "
|
36
|
-
long_desc Help.text(:
|
37
|
-
option :
|
38
|
-
|
39
|
-
|
40
|
-
opts.stack
|
41
|
-
opts.template
|
42
|
-
def generate(blueprint)
|
43
|
-
o = options.merge(
|
44
|
-
blueprint: blueprint,
|
45
|
-
generate_only: true,
|
46
|
-
)
|
47
|
-
Lono::Generate.new(o).all
|
48
|
-
end
|
49
|
-
|
50
|
-
desc "user_data NAME", "Generates user_data script for debugging."
|
51
|
-
long_desc Help.text(:user_data)
|
52
|
-
opts.clean
|
53
|
-
def user_data(blueprint, name)
|
54
|
-
Script::Build.new(blueprint, options).run
|
55
|
-
UserData.new(blueprint, options.merge(name: name)).generate
|
35
|
+
desc "list", "List blueprints, configsets, extensions, etc"
|
36
|
+
long_desc Help.text(:list)
|
37
|
+
option :type, aliases: :t, desc: "Type: IE: blueprint, configset, extension. Defaults to all"
|
38
|
+
def list
|
39
|
+
List.new(options).run
|
56
40
|
end
|
57
41
|
|
58
|
-
desc "
|
59
|
-
long_desc Help.text(
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
Lono::Inspector::Summary.new(options.merge(blueprint: blueprint)).run
|
42
|
+
desc "output BLUEPRINT", "output or preview of the deploy"
|
43
|
+
long_desc Help.text(:output)
|
44
|
+
option :format, desc: "Output formats: #{CliFormat.formats.join(', ')}"
|
45
|
+
def output(blueprint)
|
46
|
+
Lono::Cfn::Output.new(options.merge(blueprint: blueprint)).run
|
64
47
|
end
|
65
48
|
|
66
|
-
desc "
|
67
|
-
long_desc Help.text(
|
68
|
-
option :
|
69
|
-
|
70
|
-
|
71
|
-
opts.template
|
72
|
-
def xgraph(blueprint)
|
73
|
-
Lono::Inspector::Graph.new(options.merge(blueprint: blueprint)).run
|
49
|
+
desc "plan BLUEPRINT", "Plan or preview of the deploy"
|
50
|
+
long_desc Help.text(:plan)
|
51
|
+
option :out, aliases: :o, desc: "Write Change Set info to path"
|
52
|
+
def plan(blueprint)
|
53
|
+
Lono::Cfn::Plan.new(options.merge(blueprint: blueprint)).run
|
74
54
|
end
|
75
55
|
|
76
|
-
desc "seed BLUEPRINT", "
|
56
|
+
desc "seed BLUEPRINT", "Builds starter configs for a blueprint."
|
77
57
|
long_desc Help.text("seed")
|
78
58
|
option :param, desc: "override convention and specify the param file to use"
|
79
|
-
opts.
|
80
|
-
opts.template
|
81
|
-
add_runtime_options! # Thor::Action options like --force
|
59
|
+
opts.runtime_options
|
82
60
|
def seed(blueprint)
|
83
61
|
Seed.new(options.merge(blueprint: blueprint)).create
|
84
62
|
end
|
85
63
|
|
86
|
-
desc "
|
87
|
-
long_desc Help.text(
|
88
|
-
|
89
|
-
|
90
|
-
Lono::AppFile::Build.new(blueprint, options).run
|
64
|
+
desc "show BLUEPRINT", "Deploy CloudFormation stack"
|
65
|
+
long_desc Help.text(:show)
|
66
|
+
def show(blueprint)
|
67
|
+
Lono::Cfn::Show.new(options.merge(blueprint: blueprint)).run
|
91
68
|
end
|
92
69
|
|
93
|
-
desc "
|
94
|
-
|
95
|
-
|
70
|
+
desc "status BLUEPRINT", "Shows current status of blueprint."
|
71
|
+
long_desc Help.text(:status)
|
72
|
+
def status(blueprint)
|
73
|
+
names = Lono::Names.new(blueprint: blueprint)
|
74
|
+
status = Lono::Cfn::Status.new(names.stack, options)
|
75
|
+
success = status.run
|
76
|
+
exit 3 unless success
|
96
77
|
end
|
97
78
|
|
98
|
-
desc "
|
99
|
-
long_desc Help.text("
|
100
|
-
def
|
101
|
-
|
79
|
+
desc "summary BLUEPRINT", "Prints summary of CloudFormation template"
|
80
|
+
long_desc Help.text("summary")
|
81
|
+
def summary(blueprint)
|
82
|
+
Lono::Inspector::Summary.new(options.merge(blueprint: blueprint)).run
|
83
|
+
end
|
84
|
+
|
85
|
+
desc "test", "Run test."
|
86
|
+
long_desc Help.text(:test)
|
87
|
+
def test
|
88
|
+
Test.new(options).run
|
89
|
+
end
|
90
|
+
|
91
|
+
desc "up BLUEPRINT", "Deploy CloudFormation stack"
|
92
|
+
long_desc Help.text(:up)
|
93
|
+
cfn_opts.deploy
|
94
|
+
def up(blueprint)
|
95
|
+
Lono::Cfn::Deploy.new(options.merge(blueprint: blueprint)).run
|
96
|
+
end
|
97
|
+
|
98
|
+
desc "user_data BLUEPRINT NAME", "Generates user_data script for debugging."
|
99
|
+
long_desc Help.text(:user_data)
|
100
|
+
opts.clean
|
101
|
+
def user_data(blueprint, name)
|
102
|
+
Script::Build.new(options.merge(blueprint: blueprint)).run
|
103
|
+
UserData.new(options.merge(blueprint: blueprint, name: name)).generate
|
102
104
|
end
|
103
105
|
|
104
|
-
desc "completion *PARAMS", "Prints words for auto-completion
|
106
|
+
desc "completion *PARAMS", "Prints words for auto-completion"
|
105
107
|
long_desc Help.text("completion")
|
106
108
|
def completion(*params)
|
107
109
|
Completer.new(CLI, *params).run
|
108
110
|
end
|
109
111
|
|
110
|
-
desc "completion_script", "
|
112
|
+
desc "completion_script", "Builds a script that can be eval to setup auto-completion"
|
111
113
|
long_desc Help.text("completion_script")
|
112
114
|
def completion_script
|
113
|
-
Completer::Script.
|
115
|
+
Completer::Script.build
|
114
116
|
end
|
115
117
|
|
116
118
|
desc "version", "Prints version"
|
@@ -118,10 +120,6 @@ module Lono
|
|
118
120
|
puts "Lono: #{VERSION}"
|
119
121
|
end
|
120
122
|
|
121
|
-
desc "blueprint SUBCOMMAND", "blueprint subcommands"
|
122
|
-
long_desc Help.text(:blueprint)
|
123
|
-
subcommand "blueprint", Blueprint
|
124
|
-
|
125
123
|
desc "cfn SUBCOMMAND", "cfn subcommands"
|
126
124
|
long_desc Help.text(:cfn)
|
127
125
|
subcommand "cfn", Cfn
|
@@ -130,25 +128,9 @@ module Lono
|
|
130
128
|
long_desc Help.text(:code)
|
131
129
|
subcommand "code", Code
|
132
130
|
|
133
|
-
desc "
|
134
|
-
long_desc Help.text(:
|
135
|
-
subcommand "
|
136
|
-
|
137
|
-
desc "extension SUBCOMMAND", "extension subcommands"
|
138
|
-
long_desc Help.text(:extension)
|
139
|
-
subcommand "extension", Extension
|
140
|
-
|
141
|
-
desc "param SUBCOMMAND", "param subcommands"
|
142
|
-
long_desc Help.text(:param)
|
143
|
-
subcommand "param", Param
|
144
|
-
|
145
|
-
desc "pro SUBCOMMAND", "pro subcommands"
|
146
|
-
long_desc Help.text(:pro)
|
147
|
-
subcommand "pro", Pro
|
148
|
-
|
149
|
-
desc "registration SUBCOMMAND", "registration subcommands"
|
150
|
-
long_desc Help.text(:registration)
|
151
|
-
subcommand "registration", Registration
|
131
|
+
desc "new SUBCOMMAND", "new subcommands"
|
132
|
+
long_desc Help.text(:new)
|
133
|
+
subcommand "new", New
|
152
134
|
|
153
135
|
desc "s3 SUBCOMMAND", "s3 subcommands"
|
154
136
|
long_desc Help.text(:s3)
|
@@ -157,13 +139,5 @@ module Lono
|
|
157
139
|
desc "script SUBCOMMAND", "script subcommands"
|
158
140
|
long_desc Help.text(:script)
|
159
141
|
subcommand "script", Script
|
160
|
-
|
161
|
-
desc "sets SUBCOMMAND", "sets subcommands"
|
162
|
-
long_desc Help.text(:sets)
|
163
|
-
subcommand "sets", Sets
|
164
|
-
|
165
|
-
desc "template SUBCOMMAND", "template subcommands"
|
166
|
-
long_desc Help.text(:template)
|
167
|
-
subcommand "template", Template
|
168
142
|
end
|
169
143
|
end
|
data/lib/lono/command.rb
CHANGED
@@ -31,7 +31,14 @@ end
|
|
31
31
|
module Lono
|
32
32
|
class Command < Thor
|
33
33
|
class << self
|
34
|
+
include Lono::Utils::Logging
|
35
|
+
|
34
36
|
def dispatch(m, args, options, config)
|
37
|
+
# Lono.argv provides consistency when lono is being called by rspec-lono test harness
|
38
|
+
Lono.argv = args.clone # important to clone since Thor removes the first argv
|
39
|
+
|
40
|
+
check_project!(args.first)
|
41
|
+
|
35
42
|
# Allow calling for help via:
|
36
43
|
# lono command help
|
37
44
|
# lono command -h
|
@@ -58,6 +65,26 @@ module Lono
|
|
58
65
|
super
|
59
66
|
end
|
60
67
|
|
68
|
+
def check_project!(command_name)
|
69
|
+
return if subcommand?
|
70
|
+
return if command_name.nil?
|
71
|
+
return if help_flags.include?(Lono.argv.last) # IE: -h help
|
72
|
+
return if %w[-h -v --version completion completion_script help new test version].include?(command_name)
|
73
|
+
return if File.exist?("#{Lono.root}/config/app.rb")
|
74
|
+
return unless Lono.check_project
|
75
|
+
logger.error "ERROR: It doesnt look like this is a lono project. Are you sure you are in a lono project?".color(:red)
|
76
|
+
ENV['LONO_TEST'] ? raise : exit(1)
|
77
|
+
end
|
78
|
+
|
79
|
+
def help_flags
|
80
|
+
Thor::HELP_MAPPINGS + ["help"]
|
81
|
+
end
|
82
|
+
private :help_flags
|
83
|
+
|
84
|
+
def subcommand?
|
85
|
+
!!caller.detect { |l| l.include?('in subcommand') }
|
86
|
+
end
|
87
|
+
|
61
88
|
# Override command_help to include the description at the top of the
|
62
89
|
# long_description.
|
63
90
|
def command_help(shell, command_name)
|
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
class
|
1
|
+
module Lono::Configset
|
2
|
+
class Builder
|
3
|
+
include Lono::Utils::Logging
|
4
|
+
|
3
5
|
def initialize(options)
|
4
6
|
@options = options
|
5
7
|
@configset = options[:configset]
|
@@ -9,13 +11,13 @@ class Lono::Configset
|
|
9
11
|
def run
|
10
12
|
check_configset_exist!
|
11
13
|
structure = build
|
12
|
-
|
14
|
+
logger.info YAML.dump(structure)
|
13
15
|
end
|
14
16
|
|
15
17
|
def check_configset_exist!
|
16
18
|
exist = !!Lono::Finder::Configset.find(@configset)
|
17
19
|
unless exist
|
18
|
-
|
20
|
+
logger.info "configset #{@configset.color(:green)} not found."
|
19
21
|
exit 1
|
20
22
|
end
|
21
23
|
end
|
@@ -24,9 +26,9 @@ class Lono::Configset
|
|
24
26
|
# Examples:
|
25
27
|
# Erb.new(options).build
|
26
28
|
# Dsl.new(options).build
|
27
|
-
|
28
|
-
|
29
|
-
full =
|
29
|
+
builder_class = "Lono::Configset::Strategy::#{strategy.camelize}"
|
30
|
+
builder_class = Object.const_get(builder_class)
|
31
|
+
full = builder_class.new(@options.merge(root: configset_root)).build
|
30
32
|
if @options[:cli]
|
31
33
|
full["Metadata"] # contains AWS::CloudFormation::Init and optional AWS::CloudFormation::Authentication
|
32
34
|
else
|
@@ -1,7 +1,9 @@
|
|
1
1
|
require "yaml"
|
2
2
|
|
3
|
-
|
3
|
+
module Lono::Configset
|
4
4
|
class Combiner
|
5
|
+
include Lono::Utils::Logging
|
6
|
+
|
5
7
|
def initialize(cfn, options={})
|
6
8
|
@cfn, @options = cfn, options
|
7
9
|
|
@@ -33,8 +35,8 @@ class Lono::Configset
|
|
33
35
|
end
|
34
36
|
|
35
37
|
combine
|
36
|
-
Register::Blueprint.clear! # in case of lono
|
37
|
-
Register::Project.clear! # in case of lono
|
38
|
+
Register::Blueprint.clear! # in case of lono build for all templates
|
39
|
+
Register::Project.clear! # in case of lono build for all templates
|
38
40
|
@map
|
39
41
|
end
|
40
42
|
|
@@ -134,8 +136,8 @@ class Lono::Configset
|
|
134
136
|
def validate_structure!(name, metadata)
|
135
137
|
return if metadata.is_a?(Hash) && metadata.dig("Metadata", "AWS::CloudFormation::Init")
|
136
138
|
|
137
|
-
|
138
|
-
|
139
|
+
logger.info "ERROR: The #{name} configset does not appear to have a AWS::CloudFormation::Init key".color(:red)
|
140
|
+
logger.info "Please double check the #{name} configset.yml structure"
|
139
141
|
exit 1
|
140
142
|
end
|
141
143
|
|
@@ -153,7 +155,7 @@ class Lono::Configset
|
|
153
155
|
if ENV['LONO_TEST']
|
154
156
|
raise message
|
155
157
|
else
|
156
|
-
|
158
|
+
logger.info message.color(:red)
|
157
159
|
exit 1
|
158
160
|
end
|
159
161
|
end
|
data/lib/lono/configset/meta.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
module Lono::Configset::S3File
|
2
|
-
class Build < Lono::
|
3
|
-
include Lono::Utils::Rsync
|
2
|
+
class Build < Lono::CLI::Base
|
4
3
|
include Lono::Utils::Item::Zip
|
4
|
+
include Lono::Utils::Logging
|
5
|
+
include Lono::Utils::Rsync
|
5
6
|
|
6
7
|
def run
|
7
8
|
Lono::Configset::S3File::Registry.items.each do |item|
|
@@ -16,7 +17,7 @@ module Lono::Configset::S3File
|
|
16
17
|
|
17
18
|
def copy_to_output(item)
|
18
19
|
src = "#{item.root}/lib/files/#{item.name}"
|
19
|
-
dest = "#{Lono.
|
20
|
+
dest = "#{Lono.root}/output/#{@blueprint.name}/configsets/#{item.configset}/files/#{item.name}"
|
20
21
|
rsync(src, dest)
|
21
22
|
end
|
22
23
|
|
@@ -25,7 +26,7 @@ module Lono::Configset::S3File
|
|
25
26
|
if item.exist?
|
26
27
|
zip(item)
|
27
28
|
else
|
28
|
-
|
29
|
+
logger.info "WARN: #{item.src_path} does not exist. Double check that the path is correct in the s3_key call.".color(:yellow)
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
@@ -17,7 +17,7 @@ module Lono::Configset::S3File
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def output_path
|
20
|
-
"#{Lono.
|
20
|
+
"#{Lono.root}/output/#{@blueprint.name}/configsets/#{@configset}/files/#{@name}"
|
21
21
|
end
|
22
22
|
|
23
23
|
def replacement_value
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Lono::Configset::S3File
|
2
|
-
class Upload < Lono::
|
2
|
+
class Upload < Lono::CLI::Base
|
3
3
|
def upload
|
4
4
|
return unless Registry.items.size > 0
|
5
|
-
|
5
|
+
logger.info "Uploading configset files..."
|
6
6
|
|
7
7
|
Registry.items.each do |item|
|
8
8
|
Lono::S3::Uploader.new(item.zip_file_path).upload
|
@@ -14,7 +14,7 @@ module Lono::Configset::Strategy
|
|
14
14
|
include Lono::Configset::EvaluateFile
|
15
15
|
|
16
16
|
# All Lono DSL Helpers and Fn - so configsets have access to instrinic functions like ref
|
17
|
-
# Not including the Lono::Template::Strategy::Dsl::
|
17
|
+
# Not including the Lono::Builder::Template::Strategy::Dsl::Evaluator::Syntax since dont need those methods
|
18
18
|
#
|
19
19
|
# Interesting note: must include these modules here so load_project_predefined_variables works.
|
20
20
|
# Since load_project_predefined_variables calls evaluate_file / instance eval which seems to only be
|
@@ -22,15 +22,15 @@ module Lono::Configset::Strategy
|
|
22
22
|
#
|
23
23
|
# This allows methods like ref and sub to work in variables files.
|
24
24
|
#
|
25
|
-
include Lono::Template::Strategy::Dsl::
|
26
|
-
include Lono::Template::Strategy::Dsl::
|
25
|
+
include Lono::Builder::Template::Strategy::Dsl::Evaluator::Helpers
|
26
|
+
include Lono::Builder::Template::Strategy::Dsl::Evaluator::Fn
|
27
27
|
|
28
28
|
def initialize(options={})
|
29
29
|
@options = options
|
30
30
|
@configset = options[:configset]
|
31
31
|
@root = options[:root]
|
32
32
|
@resource = options[:resource] || "FakeResource"
|
33
|
-
@
|
33
|
+
@blueprin = options[:blueprint]
|
34
34
|
end
|
35
35
|
|
36
36
|
def build
|
@@ -60,8 +60,8 @@ module Lono::Configset::Strategy
|
|
60
60
|
|
61
61
|
def load_project_predefined_variables
|
62
62
|
paths = [
|
63
|
-
"#{Lono.root}/
|
64
|
-
"#{Lono.root}/
|
63
|
+
"#{Lono.root}/config/#{@blueprint.name}/configsets/variables.rb", # global
|
64
|
+
"#{Lono.root}/config/#{@blueprint.name}/configsets/variables/#{@configset}.rb", # configset specific
|
65
65
|
]
|
66
66
|
paths.each do |path|
|
67
67
|
evaluate_file(path)
|
@@ -11,7 +11,7 @@ module Lono::Configset::Strategy::Helpers::Dsl
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def s3_key(name)
|
14
|
-
Lono::Configset::S3File::Registry.register(name, blueprint: @blueprint, configset: @configset, root: @root)
|
14
|
+
Lono::Configset::S3File::Registry.register(name, blueprint: @blueprint.name, configset: @configset, root: @root)
|
15
15
|
"file://configset/#{@configset}/#{name}"
|
16
16
|
end
|
17
17
|
end
|
data/lib/lono/core.rb
CHANGED
@@ -4,79 +4,50 @@ module Lono
|
|
4
4
|
module Core
|
5
5
|
extend Memoist
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
end
|
10
|
-
memoize :config
|
7
|
+
cattr_accessor :argv
|
8
|
+
cattr_accessor :check_project, default: true
|
11
9
|
|
12
|
-
|
10
|
+
# allow testing frameworks to switch root
|
11
|
+
cattr_writer :root
|
13
12
|
def root
|
14
13
|
path = @@root || ENV['LONO_ROOT'] || Dir.pwd
|
15
14
|
Pathname.new(path)
|
16
15
|
end
|
17
|
-
memoize :root
|
18
16
|
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
def app
|
18
|
+
ENV['LONO_APP']
|
19
|
+
end
|
20
|
+
memoize :app
|
22
21
|
|
23
22
|
def env
|
24
|
-
|
25
|
-
env = env_from_profile(ENV['AWS_PROFILE']) || 'development'
|
26
|
-
env = ENV['LONO_ENV'] if ENV['LONO_ENV'] # highest precedence
|
27
|
-
env
|
23
|
+
ENV['LONO_ENV'] || 'dev'
|
28
24
|
end
|
29
25
|
memoize :env
|
30
26
|
|
31
|
-
|
32
|
-
|
33
|
-
def set_aws_profile!
|
34
|
-
return unless settings # Only load if within lono project and there's a settings.yml
|
35
|
-
data = settings[Lono.env] || {}
|
36
|
-
if data["aws_profile"]
|
37
|
-
# puts "Using AWS_PROFILE=#{data["aws_profile"]} from LONO_ENV=#{Lono.env} in configs/settings.yml"
|
38
|
-
ENV['AWS_PROFILE'] = data["aws_profile"]
|
39
|
-
end
|
27
|
+
def tmp_root
|
28
|
+
ENV['LONO_TMP_ROOT'] || "/tmp/lono"
|
40
29
|
end
|
30
|
+
memoize :tmp_root
|
41
31
|
|
42
|
-
|
43
|
-
|
44
|
-
def settings
|
45
|
-
setting = Setting.new(false) # check_lono_project to account for `lono new`
|
46
|
-
settings_path = setting.lookup_project_settings_path
|
47
|
-
return unless settings_path # in case outside of lono project
|
48
|
-
|
49
|
-
YAML.load_file(settings_path)
|
32
|
+
def log_root
|
33
|
+
"#{root}/log"
|
50
34
|
end
|
51
|
-
memoize :settings
|
52
35
|
|
53
|
-
def
|
54
|
-
|
55
|
-
puts "ERROR: A lono-pro gem installation has been detected.".color(:red)
|
56
|
-
puts <<~EOL
|
57
|
-
The lono-pro gem is now a part of lono itself. The lono-pro gem has been deprecated.
|
58
|
-
Please uninstall the lono-pro gem and remove it from your Gemfile to continue.
|
59
|
-
EOL
|
60
|
-
exit 1
|
61
|
-
end
|
36
|
+
def configure(&block)
|
37
|
+
App.instance.configure(&block)
|
62
38
|
end
|
63
39
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
false
|
40
|
+
# Generally, use the Terraspace.config instead of App.instance.config since it guarantees the load_project_config call
|
41
|
+
def config
|
42
|
+
App.instance.load_project_config
|
43
|
+
App.instance.config
|
69
44
|
end
|
45
|
+
memoize :config
|
70
46
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
settings ||= {}
|
76
|
-
profiles = settings['aws_profile']
|
77
|
-
profiles && profiles == aws_profile
|
78
|
-
end
|
79
|
-
env.first if env
|
47
|
+
# allow different logger when running up all or rspec-lono
|
48
|
+
cattr_writer :logger
|
49
|
+
def logger
|
50
|
+
@@logger ||= config.logger
|
80
51
|
end
|
81
52
|
end
|
82
53
|
end
|
data/lib/lono/extensions/dsl.rb
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
class Lono::Extensions
|
2
2
|
module Dsl
|
3
3
|
def extend_with(*args, **options)
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
def register_extension_helper(args, options={})
|
8
|
-
Lono::Jade::Registry.register_extension(args, options)
|
4
|
+
# puts "TODO: load extension straight up"
|
5
|
+
# register_extension_helper(args, options)
|
9
6
|
end
|
10
7
|
end
|
11
8
|
end
|