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.
- 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 +21 -4
- data/CONTRIBUTING.md +2 -2
- data/Gemfile +5 -1
- data/LICENSE.txt +201 -1
- data/README.md +4 -4
- 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 -195
- 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 -109
- 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 -12
- 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 -44
- metadata +246 -269
- 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 -111
- 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/set_instances/delete.md +0 -21
- data/lib/lono/help/set_instances/deploy.md +0 -31
- data/lib/lono/help/set_instances/list.md +0 -14
- data/lib/lono/help/set_instances/status.md +0 -15
- data/lib/lono/help/set_instances/sync.md +0 -92
- data/lib/lono/help/sets/delete.md +0 -8
- data/lib/lono/help/sets/deploy.md +0 -76
- 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/set_instances/base.rb +0 -30
- data/lib/lono/set_instances/changeable.rb +0 -53
- data/lib/lono/set_instances/create.rb +0 -7
- data/lib/lono/set_instances/delete.rb +0 -47
- data/lib/lono/set_instances/deploy.rb +0 -52
- data/lib/lono/set_instances/list.rb +0 -13
- data/lib/lono/set_instances/opts.rb +0 -37
- data/lib/lono/set_instances/status.rb +0 -12
- data/lib/lono/set_instances/sync.rb +0 -181
- data/lib/lono/set_instances/update.rb +0 -15
- data/lib/lono/set_instances.rb +0 -54
- data/lib/lono/sets/base.rb +0 -50
- data/lib/lono/sets/create.rb +0 -27
- data/lib/lono/sets/delete.rb +0 -43
- data/lib/lono/sets/deploy.rb +0 -11
- 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 -136
- data/lib/lono/sets/status.rb +0 -128
- data/lib/lono/sets/summarize.rb +0 -22
- data/lib/lono/sets/time_spent.rb +0 -11
- data/lib/lono/sets/update.rb +0 -74
- data/lib/lono/sets/waiter.rb +0 -23
- data/lib/lono/sets.rb +0 -34
- 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
data/lib/lono/jade/circular.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
class Lono::Jade
|
2
|
-
module Circular
|
3
|
-
def check_for_circular_dependency!
|
4
|
-
circular = circular_dependency?
|
5
|
-
return unless circular
|
6
|
-
|
7
|
-
puts "ERROR: jade circular dependency detected".color(:red)
|
8
|
-
puts "circular dependency: #{parent_names.join(" => ")}"
|
9
|
-
exit 1
|
10
|
-
end
|
11
|
-
|
12
|
-
def circular_dependency?
|
13
|
-
parent_names.uniq.size != parent_names.size
|
14
|
-
end
|
15
|
-
|
16
|
-
def parent_names
|
17
|
-
names = [self.name] # include initial jade name to detect circular dependency earlier
|
18
|
-
parent = registry.parent
|
19
|
-
while parent
|
20
|
-
names << parent.name
|
21
|
-
parent = parent.registry.parent
|
22
|
-
end
|
23
|
-
names
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
class Lono::Jade::Materializer
|
2
|
-
class Final
|
3
|
-
def build(jades)
|
4
|
-
return if jades.empty?
|
5
|
-
list = jades.map(&:name).uniq.join(", ") # possible to have different versions. only showing names and removing duplicates
|
6
|
-
puts "Materializing #{list}..."
|
7
|
-
GemsBuilder.new(jades).build
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
@@ -1,81 +0,0 @@
|
|
1
|
-
require 'open3'
|
2
|
-
|
3
|
-
class Lono::Jade::Materializer
|
4
|
-
class GemsBuilder
|
5
|
-
extend Memoist
|
6
|
-
|
7
|
-
def initialize(*jades)
|
8
|
-
@jades = jades.flatten
|
9
|
-
@build_root = "#{Lono.root}/tmp/jades"
|
10
|
-
end
|
11
|
-
|
12
|
-
def build
|
13
|
-
puts "GemsBuilder#build materializing #{@jades.map(&:name)}" if ENV['LONO_DEBUG']
|
14
|
-
remove_gemfile
|
15
|
-
gemfile = build_gemfile(@jades)
|
16
|
-
return unless gemfile
|
17
|
-
write(gemfile)
|
18
|
-
bundle
|
19
|
-
end
|
20
|
-
|
21
|
-
def build_gemfile(jades)
|
22
|
-
return if jades.empty?
|
23
|
-
|
24
|
-
lines = []
|
25
|
-
jades.each do |jade|
|
26
|
-
return if local_exist?(jade)
|
27
|
-
args = source.gem_args(jade)
|
28
|
-
line = %Q|gem #{args}|
|
29
|
-
lines << line unless lines.include?(line)
|
30
|
-
end
|
31
|
-
lines.sort!
|
32
|
-
lines.join("\n") + "\n"
|
33
|
-
end
|
34
|
-
|
35
|
-
def bundle
|
36
|
-
Bundler.with_unbundled_env do
|
37
|
-
bundle_install
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def bundle_install
|
42
|
-
command = "cd #{@build_root} && bundle install"
|
43
|
-
puts "=> #{command}" if ENV['LONO_DEBUG']
|
44
|
-
stdout, stderr, status = Open3.capture3(command)
|
45
|
-
|
46
|
-
unless status.success?
|
47
|
-
names = @jades.map(&:name)
|
48
|
-
gem_text = names.size == 1 ? "gem" : "gems"
|
49
|
-
puts "Fail to build #{gem_text} #{names.join(', ')}".color(:red)
|
50
|
-
puts "Failed running => #{command}"
|
51
|
-
puts stdout
|
52
|
-
puts stderr
|
53
|
-
if stderr.include?("correct access rights")
|
54
|
-
puts "Are you sure you have access to the git repo and the repo exists?".color(:yellow)
|
55
|
-
end
|
56
|
-
exit 1
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
# When a local version is found, will use that version
|
61
|
-
def local_exist?(jade)
|
62
|
-
!!jade.finder.find(jade.name, local_only: true)
|
63
|
-
end
|
64
|
-
|
65
|
-
def write(gemfile)
|
66
|
-
path = "#{@build_root}/Gemfile"
|
67
|
-
FileUtils.mkdir_p(File.dirname(path))
|
68
|
-
IO.write(path, gemfile)
|
69
|
-
end
|
70
|
-
|
71
|
-
def remove_gemfile
|
72
|
-
FileUtils.rm_f("#{@build_root}/Gemfile")
|
73
|
-
FileUtils.rm_f("#{@build_root}/Gemfile.lock")
|
74
|
-
end
|
75
|
-
|
76
|
-
def source
|
77
|
-
Source.new
|
78
|
-
end
|
79
|
-
memoize :source
|
80
|
-
end
|
81
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
class Lono::Jade::Materializer
|
2
|
-
class Source
|
3
|
-
def initialize(lono_settings=nil)
|
4
|
-
@lono_settings = lono_settings || Lono::Setting.new.data
|
5
|
-
end
|
6
|
-
|
7
|
-
# String provide to gem method in Gemfile. Example:
|
8
|
-
#
|
9
|
-
# gem "mygem", "v0.1.0", git: "xxx"
|
10
|
-
#
|
11
|
-
def gem_args(jade)
|
12
|
-
args = jade.registry.args
|
13
|
-
args = args.map { |s| %Q|"#{s}"| }.join(', ')
|
14
|
-
|
15
|
-
options = options(jade)
|
16
|
-
options = options.inject([]) { |r,(k,v)| r << %Q|#{k}: "#{v}"| }.join(', ')
|
17
|
-
|
18
|
-
"#{args}, #{options}"
|
19
|
-
end
|
20
|
-
|
21
|
-
def options(jade)
|
22
|
-
registry = jade.registry
|
23
|
-
options = registry.gem_options
|
24
|
-
# Direct source provided as part of configset call
|
25
|
-
#
|
26
|
-
# configset("ssm", git: "https://github.com/owner/ssm")
|
27
|
-
# configset("ssm", path: "/path/to/ssm")
|
28
|
-
# configset("ssm", source: "https://rubygems.org")
|
29
|
-
#
|
30
|
-
if options.key?(:git) || options.key?(:path) || options.key?(:source)
|
31
|
-
return(options)
|
32
|
-
end
|
33
|
-
|
34
|
-
# Otherwise use the sources location settings, which does not include the repo name
|
35
|
-
materalized_options = if location.include?("git@") || location.include?("https")
|
36
|
-
{git: "#{location}/#{jade.repo}"}
|
37
|
-
else
|
38
|
-
{path: "#{location}/#{jade.repo}"}
|
39
|
-
end
|
40
|
-
materalized_options.merge(options)
|
41
|
-
end
|
42
|
-
|
43
|
-
def location
|
44
|
-
ENV["LONO_MATERIALIZED_GEMS_SOURCE"] ||
|
45
|
-
Lono::Configset::Register::Blueprint.source ||
|
46
|
-
settings["source"] ||
|
47
|
-
"git@github.com:boltopspro" # default_location
|
48
|
-
end
|
49
|
-
|
50
|
-
def settings
|
51
|
-
@lono_settings.dig("materialized_gems") || {}
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
data/lib/lono/jade/registry.rb
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
class Lono::Jade
|
2
|
-
class Registry
|
3
|
-
attr_reader :args, :options
|
4
|
-
attr_accessor :caller_line, :parent, :depends_on
|
5
|
-
def initialize(args, options)
|
6
|
-
@args, @options = args, options
|
7
|
-
end
|
8
|
-
|
9
|
-
def name
|
10
|
-
@args.first
|
11
|
-
end
|
12
|
-
|
13
|
-
def gem_options
|
14
|
-
options = @options.dup
|
15
|
-
# Delete special options that is not supported by bundler Gemfile
|
16
|
-
options.delete(:repo)
|
17
|
-
options.delete(:resource) # configset
|
18
|
-
options.delete(:vars) # configset
|
19
|
-
options
|
20
|
-
end
|
21
|
-
|
22
|
-
# configset
|
23
|
-
def resource
|
24
|
-
@options[:resource]
|
25
|
-
end
|
26
|
-
|
27
|
-
def resource=(v)
|
28
|
-
@options[:resource] = v
|
29
|
-
end
|
30
|
-
|
31
|
-
def vars
|
32
|
-
options[:vars] || {}
|
33
|
-
end
|
34
|
-
|
35
|
-
class_attribute :tracked_configsets, default: []
|
36
|
-
class_attribute :downloaded_configsets, default: []
|
37
|
-
class_attribute :tracked_extensions, default: []
|
38
|
-
class_attribute :downloaded_extensions, default: []
|
39
|
-
|
40
|
-
class << self
|
41
|
-
def register_configset(args, options)
|
42
|
-
registry = new(args, options)
|
43
|
-
jade_type = determine_jade_type(caller)
|
44
|
-
jade = Lono::Jade.new(registry.name, jade_type, registry)
|
45
|
-
self.tracked_configsets << jade
|
46
|
-
registry
|
47
|
-
end
|
48
|
-
|
49
|
-
def determine_jade_type(caller)
|
50
|
-
if caller.detect { |l| l =~ %r{config/configsets.rb} }
|
51
|
-
'blueprint/configset'
|
52
|
-
else
|
53
|
-
'configset'
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def register_extension(args, options)
|
58
|
-
registry = new(args, options)
|
59
|
-
self.tracked_extensions << registry
|
60
|
-
registry
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
data/lib/lono/jade.rb
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
module Lono
|
2
|
-
class Jade
|
3
|
-
include Circular
|
4
|
-
extend Memoist
|
5
|
-
|
6
|
-
delegate :source_type, to: :jadespec
|
7
|
-
|
8
|
-
attr_accessor :dependencies, :from, :depends_ons
|
9
|
-
attr_reader :name, :type, :registry, :jadespec
|
10
|
-
def initialize(name, type, registry={})
|
11
|
-
# type: one of blueprint, configset, blueprint/configset
|
12
|
-
# registry holds either original registry from configset definition or parent jade which can be used to get the original configset defintion
|
13
|
-
@name, @type, @registry = name, type, registry
|
14
|
-
@materialized = false
|
15
|
-
@resolved = false
|
16
|
-
@depends_ons = []
|
17
|
-
end
|
18
|
-
|
19
|
-
def repo
|
20
|
-
@registry.options[:repo] || @name
|
21
|
-
end
|
22
|
-
|
23
|
-
# root is kind of special. root is needed for materialization but can accidentally get called too early
|
24
|
-
# before materialization. So treat it specially with an error.
|
25
|
-
def root
|
26
|
-
raise "ERROR: root is not available until jade has been materialized" unless @jadespec
|
27
|
-
@jadespec.root
|
28
|
-
end
|
29
|
-
|
30
|
-
def dependencies
|
31
|
-
@depends_ons.map do |registry|
|
32
|
-
jade = Lono::Jade.new(registry.depends_on, registry.parent.type, registry) # not same sig as register_configset?
|
33
|
-
Lono::Jade::Registry.tracked_configsets << jade
|
34
|
-
jade
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def resource_from_parent
|
39
|
-
parent = registry.parent # using local variable intentionally
|
40
|
-
resource = nil
|
41
|
-
while parent # go all the way to the highest parent
|
42
|
-
resource = parent.registry.resource
|
43
|
-
parent = parent.registry.parent
|
44
|
-
end
|
45
|
-
resource
|
46
|
-
end
|
47
|
-
|
48
|
-
def materialize
|
49
|
-
@jadespec = finder.find(@name)
|
50
|
-
download unless @jadespec
|
51
|
-
# Pretty tricky. Flush memoized finder(true) since download changes filesystem. Not memoizing at all is 2x slower
|
52
|
-
@jadespec = finder(true).find(@name)
|
53
|
-
return nil unless @jadespec
|
54
|
-
if @jadespec.source_type == "materialized"
|
55
|
-
# possible "duplicated" jade instances with same name but will uniq in final materialized Gemfile
|
56
|
-
case @jadespec.lono_type
|
57
|
-
when "configset"
|
58
|
-
Lono::Jade::Registry.downloaded_configsets << self
|
59
|
-
when "extension"
|
60
|
-
Lono::Jade::Registry.downloaded_extensions << self
|
61
|
-
end
|
62
|
-
end
|
63
|
-
evaluate_meta_rb
|
64
|
-
@jadespec
|
65
|
-
end
|
66
|
-
memoize :materialize
|
67
|
-
|
68
|
-
# Must return config to set @jadespec in materialize
|
69
|
-
# Only allow download of Lono::Blueprint::Configset::Jade
|
70
|
-
# Other configsets should be configured in project Gemfile.
|
71
|
-
#
|
72
|
-
# Cases:
|
73
|
-
#
|
74
|
-
# 1a) blueprint/configset top-level - download
|
75
|
-
# 1b) blueprint/configset depends_on - download
|
76
|
-
# 2a) configset top-level - dont download, will report to user with validate_all!
|
77
|
-
# 2b) configset depends_on - download
|
78
|
-
# 3) extension - download
|
79
|
-
#
|
80
|
-
def download
|
81
|
-
return if finder.find(@name, local_only: true) # no need to download because locally found
|
82
|
-
return unless %w[blueprint/configset configset extension].include?(@type)
|
83
|
-
# Comment out. Unsure if this complexity is worth it. Always download jades.
|
84
|
-
# Only download jades that came from depends_on
|
85
|
-
# return unless @registry.parent || %w[blueprint/configset extension].include?(@type)
|
86
|
-
materializer = Materializer.new(self)
|
87
|
-
materializer.build
|
88
|
-
end
|
89
|
-
memoize :download
|
90
|
-
|
91
|
-
def evaluate_meta_rb
|
92
|
-
return unless %w[blueprint/configset configset].include?(@type)
|
93
|
-
meta = Lono::Configset::Meta.new(self)
|
94
|
-
meta.evaluate
|
95
|
-
end
|
96
|
-
|
97
|
-
def resolved!
|
98
|
-
@resolved = true
|
99
|
-
end
|
100
|
-
|
101
|
-
def resolved?
|
102
|
-
@resolved
|
103
|
-
end
|
104
|
-
|
105
|
-
def finder
|
106
|
-
"Lono::Finder::#{@type.camelize}".constantize.new
|
107
|
-
end
|
108
|
-
memoize :finder
|
109
|
-
end
|
110
|
-
end
|
data/lib/lono/jadespec.rb
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
require "rubygems"
|
2
|
-
|
3
|
-
module Lono
|
4
|
-
class Jadespec
|
5
|
-
extend Memoist
|
6
|
-
|
7
|
-
attr_accessor :from
|
8
|
-
attr_reader :root, :source_type
|
9
|
-
def initialize(root, source_type)
|
10
|
-
@root, @source_type = root, source_type
|
11
|
-
end
|
12
|
-
|
13
|
-
def name
|
14
|
-
exist? ? gemspec.name : "not gemspec file found for @root: #{@root}"
|
15
|
-
end
|
16
|
-
|
17
|
-
def exist?
|
18
|
-
!!gemspec_file
|
19
|
-
end
|
20
|
-
|
21
|
-
def gemspec
|
22
|
-
Gem::Specification::load(gemspec_file)
|
23
|
-
end
|
24
|
-
memoize :gemspec
|
25
|
-
|
26
|
-
def gemspec_file
|
27
|
-
Dir.glob("#{@root}/*.gemspec").first
|
28
|
-
end
|
29
|
-
|
30
|
-
def lono_type
|
31
|
-
deprecation_check(metadata)
|
32
|
-
metadata["lono_type"] || detect_type
|
33
|
-
end
|
34
|
-
|
35
|
-
def detect_type
|
36
|
-
configset = Dir.glob("#{@root}/lib/configset.*").size > 0
|
37
|
-
configset ? "configset" : "blueprint"
|
38
|
-
end
|
39
|
-
|
40
|
-
def lono_strategy
|
41
|
-
deprecation_check(metadata)
|
42
|
-
return metadata["lono_strategy"] if metadata["lono_strategy"]
|
43
|
-
lono_type == "blueprint" ? "dsl" : "erb" # TODO: default to dsl for configset also in next major release
|
44
|
-
end
|
45
|
-
|
46
|
-
# backward-compatiable for now
|
47
|
-
def auto_camelize
|
48
|
-
metadata["lono_auto_camelize"] || false
|
49
|
-
end
|
50
|
-
|
51
|
-
def metadata
|
52
|
-
gemspec.metadata || {}
|
53
|
-
end
|
54
|
-
memoize :metadata
|
55
|
-
|
56
|
-
private
|
57
|
-
@@deprecation_check_shown = {}
|
58
|
-
def deprecation_check(metadata)
|
59
|
-
return unless ENV['LONO_DEPRECATION_SOFT']
|
60
|
-
return if @@deprecation_check_shown[name]
|
61
|
-
|
62
|
-
unless metadata["lono_type"]
|
63
|
-
puts "DEPRECATION WARNING: lono_type is not set for #{name}".color(:yellow)
|
64
|
-
end
|
65
|
-
@@deprecation_check_shown[name] = true
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
data/lib/lono/new/helper.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
module Lono::New::Helper
|
2
|
-
private
|
3
|
-
def project_class_name
|
4
|
-
project_name.underscore.camelize
|
5
|
-
end
|
6
|
-
|
7
|
-
# Files should be named with underscores instead of dashes even though project name can contain a dash.
|
8
|
-
# This is because autoloading works with underscores in the filenames only.
|
9
|
-
def underscored_name
|
10
|
-
project_name.underscore
|
11
|
-
end
|
12
|
-
|
13
|
-
# project_name is also available from new.rb:
|
14
|
-
# argument :project_name
|
15
|
-
end
|
data/lib/lono/new.rb
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
module Lono
|
2
|
-
class New < Sequence
|
3
|
-
include Helper
|
4
|
-
|
5
|
-
argument :project_name
|
6
|
-
|
7
|
-
# Ugly, but when the class_option is only defined in the Thor::Group class
|
8
|
-
# it doesnt show up with cli-template new help :(
|
9
|
-
# If anyone knows how to fix this let me know.
|
10
|
-
# Also options from the cli can be pass through to here
|
11
|
-
def self.cli_options
|
12
|
-
[
|
13
|
-
[:bundle, type: :boolean, default: true, desc: "Runs bundle install on the project"],
|
14
|
-
[:demo, type: :boolean, default: false, desc: "Also generate demo blueprint"],
|
15
|
-
[:force, type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files."],
|
16
|
-
[:git, type: :boolean, default: true, desc: "Git initialize the project"],
|
17
|
-
[:type, default: "dsl", desc: "Blueprint type: dsl or erb"],
|
18
|
-
]
|
19
|
-
end
|
20
|
-
|
21
|
-
cli_options.each do |args|
|
22
|
-
class_option(*args)
|
23
|
-
end
|
24
|
-
|
25
|
-
# for specs
|
26
|
-
def set_cwd
|
27
|
-
@cwd = Dir.pwd
|
28
|
-
end
|
29
|
-
|
30
|
-
def create_project
|
31
|
-
puts "=> Creating new project called #{project_name}."
|
32
|
-
directory ".", "#{@cwd}/#{project_name}"
|
33
|
-
end
|
34
|
-
|
35
|
-
def create_starter_blueprint
|
36
|
-
return unless @options[:demo]
|
37
|
-
# https://github.com/erikhuda/thor/wiki/Invocations
|
38
|
-
Lono::Blueprint::New.start(["demo", "--from-new", "--type", @options[:type], "--project-name", project_name])
|
39
|
-
end
|
40
|
-
|
41
|
-
# After this commands are executed with the newly created project
|
42
|
-
def set_destination_root
|
43
|
-
destination_root = "#{@cwd}/#{project_name}"
|
44
|
-
self.destination_root = destination_root
|
45
|
-
FileUtils.cd(self.destination_root)
|
46
|
-
end
|
47
|
-
|
48
|
-
def make_executable
|
49
|
-
chmod("exe", 0755 & ~File.umask, verbose: false) if File.exist?("exe")
|
50
|
-
end
|
51
|
-
|
52
|
-
def git_init
|
53
|
-
return if File.exist?(".git") # this is a clone repo
|
54
|
-
run_git_init
|
55
|
-
end
|
56
|
-
|
57
|
-
def bundle_install
|
58
|
-
return unless options[:bundle]
|
59
|
-
|
60
|
-
puts "=> Installing dependencies with: bundle install"
|
61
|
-
Bundler.with_unbundled_env do
|
62
|
-
system("BUNDLE_IGNORE_CONFIG=1 bundle install")
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def git_commit
|
67
|
-
run_git_commit
|
68
|
-
end
|
69
|
-
|
70
|
-
def welcome_message
|
71
|
-
puts <<~EOL
|
72
|
-
#{"="*64}
|
73
|
-
Congrats 🎉 You have successfully created a lono project. Check things out by going into the created infra folder.
|
74
|
-
|
75
|
-
cd #{project_name}
|
76
|
-
|
77
|
-
To create a new blueprint run:
|
78
|
-
|
79
|
-
lono blueprint new demo
|
80
|
-
|
81
|
-
To deploy the blueprint:
|
82
|
-
|
83
|
-
lono cfn deploy my-demo --blueprint demo
|
84
|
-
|
85
|
-
If you name the stack according to conventions, you can run:
|
86
|
-
|
87
|
-
lono cfn deploy demo
|
88
|
-
|
89
|
-
To list and create additional blueprints refer to https://lono.cloud/docs/core/blueprints
|
90
|
-
|
91
|
-
More info: https://lono.cloud/
|
92
|
-
EOL
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
data/lib/lono/param.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
module Lono
|
2
|
-
class Param < Command
|
3
|
-
class_option :verbose, type: :boolean
|
4
|
-
class_option :noop, type: :boolean
|
5
|
-
class_option :mute, type: :boolean
|
6
|
-
|
7
|
-
desc "generate BLUEPRINT", "Generate parameter output files to `output/params`."
|
8
|
-
long_desc Lono::Help.text("param/generate")
|
9
|
-
option :stack, desc: "stack name. defaults to blueprint name."
|
10
|
-
def generate(blueprint)
|
11
|
-
Generator.new(options.merge(blueprint: blueprint)).generate
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
data/lib/lono/pro/base.rb
DELETED
data/lib/lono/pro/repo.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
class Lono::Pro
|
2
|
-
class Repo < Base
|
3
|
-
def run
|
4
|
-
data = api.repos(@options[:type])
|
5
|
-
# data = data[7..9]
|
6
|
-
header = ["Name", "Docs", "Description"]
|
7
|
-
rows = data.map do |d|
|
8
|
-
desc = truncate(d[:description])
|
9
|
-
[d[:name], d[:docs_url], desc]
|
10
|
-
end
|
11
|
-
show_table(header, rows)
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
def truncate(string, max=36)
|
16
|
-
string.length > max ? "#{string[0...max]}..." : string
|
17
|
-
end
|
18
|
-
|
19
|
-
def show_table(header, data)
|
20
|
-
table = Text::Table.new
|
21
|
-
table.head = header
|
22
|
-
data.each do |item|
|
23
|
-
table.rows << item
|
24
|
-
end
|
25
|
-
puts table
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
data/lib/lono/pro.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
module Lono
|
2
|
-
class Pro < Lono::Command
|
3
|
-
desc "blueprints", "Lists available BoltOps Pro blueprints"
|
4
|
-
long_desc Help.text("pro/blueprints")
|
5
|
-
def blueprints
|
6
|
-
Repo.new(options.merge(type: "blueprint")).run
|
7
|
-
end
|
8
|
-
|
9
|
-
desc "configsets", "Lists available BoltOps Pro configsets"
|
10
|
-
long_desc Help.text("pro/configsets")
|
11
|
-
def configsets
|
12
|
-
Repo.new(options.merge(type: "configset")).run
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
data/lib/lono/project_checker.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module Lono
|
3
|
-
# Checks to see command is running in a lono project.
|
4
|
-
# If not, provide a friendly message and possibly exit.
|
5
|
-
class ProjectChecker
|
6
|
-
class << self
|
7
|
-
@@checked = false
|
8
|
-
def check
|
9
|
-
return if @@checked
|
10
|
-
|
11
|
-
unless File.exist?("#{Lono.root}/configs/settings.yml")
|
12
|
-
puts "ERROR: Could not find configs/settings.yml file. Are you sure you are in lono project?".color(:red)
|
13
|
-
quit 1
|
14
|
-
end
|
15
|
-
|
16
|
-
@@checked = true
|
17
|
-
end
|
18
|
-
|
19
|
-
# Dont exit for this one. It's okay. But show a warning.
|
20
|
-
def empty_templates
|
21
|
-
if Dir["#{Lono.config.templates_path}/**/*"].empty?
|
22
|
-
puts "INFO: The app/templates folder does not contain any lono template definitions.".color(:yellow)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def quit(signal)
|
27
|
-
if ENV['LONO_TEST'] == '1'
|
28
|
-
signal == 0 || raise("Not in lono project. pwd: #{Dir.pwd}")
|
29
|
-
else
|
30
|
-
exit(signal)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
class Lono::Registration
|
2
|
-
class Base
|
3
|
-
extend Memoist
|
4
|
-
|
5
|
-
def initialize(options={})
|
6
|
-
@options = options
|
7
|
-
end
|
8
|
-
|
9
|
-
# Same api call for temp_key and registration_key
|
10
|
-
def request_verification(info)
|
11
|
-
with_safety do
|
12
|
-
api.verify(info)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def get_temp_key
|
17
|
-
with_safety do
|
18
|
-
api.temp_key # grab temp registration key
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def with_safety
|
23
|
-
yield
|
24
|
-
rescue Errno::ECONNREFUSED, Errno::EAFNOSUPPORT
|
25
|
-
raise if Lono::API != Lono::API_DEFAULT
|
26
|
-
end
|
27
|
-
|
28
|
-
def api
|
29
|
-
Lono::Api::Client.new
|
30
|
-
end
|
31
|
-
memoize :api
|
32
|
-
|
33
|
-
def say(msg)
|
34
|
-
puts msg if @options[:cli]
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|