lono 7.5.2 → 8.0.0.pre.rc3
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 +46 -5
- data/CONTRIBUTING.md +2 -2
- data/Gemfile +3 -1
- data/LICENSE.txt +201 -1
- data/README.md +6 -11
- data/lib/lono/api/client.rb +3 -2
- data/lib/lono/app/callable_option/concern.rb +12 -0
- data/lib/lono/app/callable_option.rb +56 -0
- data/lib/lono/app/inits.rb +13 -0
- data/lib/lono/app.rb +73 -0
- data/lib/lono/autoloader.rb +3 -2
- data/lib/lono/aws_services/helper.rb +41 -6
- data/lib/lono/aws_services.rb +37 -6
- data/lib/lono/blueprint.rb +3 -11
- data/lib/lono/booter.rb +28 -0
- data/lib/lono/builder/allow/base.rb +54 -0
- data/lib/lono/builder/allow/env.rb +17 -0
- data/lib/lono/builder/allow/region.rb +20 -0
- data/lib/lono/builder/allow.rb +8 -0
- data/lib/lono/builder/configset/combiner.rb +145 -0
- data/lib/lono/builder/configset/definition/base.rb +47 -0
- data/lib/lono/builder/configset/definition/context.rb +29 -0
- data/lib/lono/{configset/strategy/helpers/dsl → builder/configset/definition/dsl/syntax}/auth.rb +1 -1
- data/lib/lono/{configset/strategy/helpers/dsl/core.rb → builder/configset/definition/dsl/syntax/content.rb} +11 -3
- data/lib/lono/{configset/strategy/helpers/dsl/syntax.rb → builder/configset/definition/dsl/syntax/core.rb} +15 -9
- data/lib/lono/{configset/strategy/helpers/dsl → builder/configset/definition/dsl/syntax}/package.rb +1 -1
- data/lib/lono/builder/configset/definition/dsl/syntax.rb +5 -0
- data/lib/lono/{configset/strategy → builder/configset/definition}/dsl.rb +10 -14
- data/lib/lono/{configset/strategy → builder/configset/definition}/erb.rb +13 -16
- data/lib/lono/builder/configset/definition.rb +18 -0
- data/lib/lono/builder/configset/evaluator.rb +10 -0
- data/lib/lono/builder/configset/registration.rb +35 -0
- data/lib/lono/builder/context.rb +40 -0
- data/lib/lono/builder/dsl/evaluator.rb +45 -0
- data/lib/lono/builder/dsl/finalizer/base.rb +8 -0
- data/lib/lono/builder/dsl/finalizer/configsets.rb +20 -0
- data/lib/lono/builder/dsl/finalizer/files/base.rb +4 -0
- data/lib/lono/builder/dsl/finalizer/files/build.rb +58 -0
- data/lib/lono/builder/dsl/finalizer/files/replace.rb +31 -0
- data/lib/lono/builder/dsl/finalizer/files.rb +9 -0
- data/lib/lono/{template/strategy → builder}/dsl/finalizer/parameter_groups.rb +6 -5
- data/lib/lono/builder/dsl/finalizer.rb +15 -0
- data/lib/lono/{template/strategy/dsl/builder/helpers/ec2_helper.rb → builder/dsl/helpers/ec2.rb} +3 -3
- data/lib/lono/builder/dsl/helpers/files.rb +7 -0
- data/lib/lono/builder/dsl/helpers/partials.rb +140 -0
- data/lib/lono/{template/strategy/dsl/builder/helpers/s3_helper.rb → builder/dsl/helpers/s3.rb} +3 -3
- data/lib/lono/{template/context/ssm_fetcher.rb → builder/dsl/helpers/ssm/fetcher.rb} +5 -3
- data/lib/lono/{template/context/helpers.rb → builder/dsl/helpers/ssm.rb} +3 -3
- data/lib/lono/{template/strategy/dsl/builder/helpers/stack_helper.rb → builder/dsl/helpers/stack.rb} +14 -9
- data/lib/lono/{template/strategy/dsl/builder/helpers/tags_helper.rb → builder/dsl/helpers/tags.rb} +2 -2
- data/lib/lono/builder/dsl/helpers/template_file.rb +66 -0
- data/lib/lono/builder/dsl/helpers.rb +5 -0
- data/lib/lono/builder/dsl/syntax/core/base.rb +22 -0
- data/lib/lono/{template/strategy/dsl/builder/section → builder/dsl/syntax/core}/condition.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder/section → builder/dsl/syntax/core}/mapping.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder/section → builder/dsl/syntax/core}/output.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder/section → builder/dsl/syntax/core}/parameter.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder/section → builder/dsl/syntax/core}/resource/property_mover.rb +12 -2
- data/lib/lono/{template/strategy/dsl/builder/section → builder/dsl/syntax/core}/resource.rb +1 -1
- data/lib/lono/{template/strategy/dsl/builder/section → builder/dsl/syntax/core}/section.rb +1 -1
- data/lib/lono/builder/dsl/syntax/core/squeezer.rb +38 -0
- data/lib/lono/{template/strategy/dsl/builder/section/methods.rb → builder/dsl/syntax/core.rb} +8 -8
- data/lib/lono/{template/strategy/dsl/builder → builder/dsl/syntax}/fn.rb +2 -2
- data/lib/lono/{template/strategy/dsl/builder → builder/dsl}/syntax/parameter_group.rb +1 -1
- data/lib/lono/builder/dsl/syntax.rb +9 -0
- data/lib/lono/builder/dsl.rb +14 -0
- data/lib/lono/{param/generator.rb → builder/param.rb} +24 -22
- data/lib/lono/builder/template/aws_service.rb +15 -0
- data/lib/lono/builder/template/bashify.rb +43 -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/builder/template/upload.rb +8 -0
- data/lib/lono/builder/template.rb +55 -0
- data/lib/lono/{template/strategy/dsl/builder → builder/util}/stringify.rb +1 -1
- 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 +18 -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 +33 -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 +12 -29
- 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 +48 -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 +100 -5
- data/lib/lono/cfn/download.rb +4 -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 +62 -0
- data/lib/lono/cfn/plan/diff/file.rb +57 -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 +34 -0
- data/lib/lono/cfn/show.rb +30 -0
- data/lib/lono/cfn/status.rb +1 -1
- data/lib/lono/cli/abstract.rb +11 -0
- data/lib/lono/cli/base.rb +11 -0
- data/lib/lono/cli/build.rb +47 -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 +23 -0
- data/lib/lono/cli/code.rb +22 -0
- 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 -1
- 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/helper/blueprint.md +17 -0
- data/lib/lono/cli/help/new/helper/project.md +16 -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/cli/help/seed.md +24 -0
- 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 +25 -0
- data/lib/lono/cli/new/blueprint.rb +29 -0
- data/lib/lono/cli/new/concerns.rb +16 -0
- data/lib/lono/cli/new/configset.rb +37 -0
- data/lib/lono/{extension/new.rb → cli/new/extension.rb} +2 -10
- data/lib/lono/cli/new/helper/blueprint.rb +26 -0
- data/lib/lono/cli/new/helper/project.rb +24 -0
- data/lib/lono/cli/new/helper.rb +13 -0
- data/lib/lono/cli/new/project.rb +77 -0
- data/lib/lono/cli/new/sequence.rb +56 -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 +27 -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/status.rb +18 -0
- data/lib/lono/cli/test.rb +35 -0
- data/lib/lono/cli.rb +78 -109
- data/lib/lono/command.rb +27 -1
- data/lib/lono/component.rb +29 -0
- data/lib/lono/concerns/aws_info.rb +14 -0
- data/lib/lono/concerns/names.rb +9 -0
- data/lib/lono/configset.rb +11 -10
- data/lib/lono/core.rb +25 -54
- data/lib/lono/ext/core/module.rb +31 -0
- data/lib/lono/ext/core/object.rb +32 -0
- data/lib/lono/ext/core/string.rb +9 -0
- data/lib/lono/ext.rb +4 -0
- data/lib/lono/files/base.rb +12 -0
- data/lib/lono/files/builder.rb +37 -0
- data/lib/lono/files/compressor.rb +53 -0
- data/lib/lono/files/concerns/post_processing.rb +35 -0
- data/lib/lono/files/concerns/registration.rb +13 -0
- data/lib/lono/files/registry.rb +6 -0
- data/lib/lono/files.rb +37 -0
- data/lib/lono/importer/base.rb +6 -6
- data/lib/lono/importer/download.rb +7 -7
- data/lib/lono/importer/dsl.rb +3 -3
- data/lib/lono/importer/service/coder.rb +67 -63
- data/lib/lono/importer.rb +1 -10
- data/lib/lono/inspector/base.rb +7 -7
- data/lib/lono/inspector/summary.rb +18 -19
- data/lib/lono/layering/layer.rb +112 -0
- data/lib/lono/layering.rb +13 -55
- data/lib/lono/logger/formatter.rb +13 -0
- data/lib/lono/logger.rb +32 -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 +42 -42
- data/lib/lono/s3/rollback.rb +8 -0
- data/lib/lono/s3/uploader.rb +33 -34
- 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/seeder.rb +110 -0
- data/lib/lono/user_data.rb +10 -13
- 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/yamler/validator.rb +7 -22
- data/lib/lono.rb +15 -12
- data/lib/templates/blueprint/template.rb +2 -0
- data/lib/templates/configset/configset.rb +2 -0
- data/lib/templates/examples/blueprint/template.rb +9 -0
- data/lib/templates/{configset/lib → examples/configset}/configset.rb +0 -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 +282 -296
- 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/app_file/base.rb +0 -28
- data/lib/lono/app_file/build/lambda_layer/ruby_packager.rb +0 -153
- data/lib/lono/app_file/build/lambda_layer.rb +0 -20
- data/lib/lono/app_file/build.rb +0 -84
- data/lib/lono/app_file/registry/item.rb +0 -24
- data/lib/lono/app_file/registry.rb +0 -16
- data/lib/lono/app_file/upload.rb +0 -12
- 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/code.rb +0 -22
- data/lib/lono/configset/combiner.rb +0 -162
- data/lib/lono/configset/evaluate_file.rb +0 -8
- data/lib/lono/configset/generator.rb +0 -57
- data/lib/lono/configset/list.rb +0 -67
- data/lib/lono/configset/meta/dsl.rb +0 -12
- data/lib/lono/configset/meta.rb +0 -19
- data/lib/lono/configset/new.rb +0 -77
- 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/s3_file/build.rb +0 -33
- data/lib/lono/configset/s3_file/item.rb +0 -38
- data/lib/lono/configset/s3_file/registry.rb +0 -12
- data/lib/lono/configset/s3_file/upload.rb +0 -12
- data/lib/lono/configset/strategy/base.rb +0 -83
- data/lib/lono/configset/strategy/helpers/dsl.rb +0 -8
- data/lib/lono/configset/strategy/helpers/erb.rb +0 -9
- 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/extension/helper.rb +0 -13
- data/lib/lono/extension/list.rb +0 -40
- data/lib/lono/extension.rb +0 -9
- data/lib/lono/extensions/dsl.rb +0 -11
- data/lib/lono/extensions/loader.rb +0 -30
- data/lib/lono/extensions/preparer.rb +0 -26
- data/lib/lono/extensions/register.rb +0 -15
- data/lib/lono/extensions.rb +0 -18
- 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/seed.md +0 -23
- 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/base.rb +0 -116
- data/lib/lono/seed/service_role.rb +0 -11
- 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/configset_injector.rb +0 -52
- data/lib/lono/template/context/loader/load_files.rb +0 -24
- data/lib/lono/template/context/loader.rb +0 -52
- data/lib/lono/template/context.rb +0 -29
- data/lib/lono/template/evaluate.rb +0 -40
- 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/helpers/core_helper.rb +0 -14
- data/lib/lono/template/strategy/dsl/builder/helpers/file_helper.rb +0 -48
- data/lib/lono/template/strategy/dsl/builder/helpers.rb +0 -16
- data/lib/lono/template/strategy/dsl/builder/section/base.rb +0 -30
- data/lib/lono/template/strategy/dsl/builder/squeezer.rb +0 -24
- data/lib/lono/template/strategy/dsl/builder/syntax/extend_with.rb +0 -9
- data/lib/lono/template/strategy/dsl/builder/syntax.rb +0 -11
- data/lib/lono/template/strategy/dsl/builder.rb +0 -59
- data/lib/lono/template/strategy/dsl/finalizer.rb +0 -12
- 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/upload.rb +0 -23
- 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/lono/utils/item/file_methods.rb +0 -29
- data/lib/lono/utils/item/zip.rb +0 -42
- 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/.circleci/README.md
DELETED
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
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
data/.gitmodules
DELETED
data/lib/lono/abstract_base.rb
DELETED
@@ -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
|
data/lib/lono/app_file/base.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# Naming AppFile instead of File so we dont to use ::File for normal regular File class
|
2
|
-
module Lono::AppFile
|
3
|
-
class Base < Lono::AbstractBase
|
4
|
-
# What's needed for a Thor::Group or "Sequence". Gives us Thor::Actions commands like create_file
|
5
|
-
# Must be included before `def initialize` as we override the Thor initialize
|
6
|
-
include Thor::Actions
|
7
|
-
include Thor::Base
|
8
|
-
# Override Thor::Base initialize
|
9
|
-
def initialize(options={})
|
10
|
-
reinitialize(options)
|
11
|
-
initialize_variables
|
12
|
-
end
|
13
|
-
|
14
|
-
def initialize_variables
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
# Hack Thor to be able to dynamically set the source_paths at runtime instance methods
|
19
|
-
def override_source_paths(*paths)
|
20
|
-
# Using string with instance_eval because block doesnt have access to path at runtime.
|
21
|
-
self.class.instance_eval %{
|
22
|
-
def self.source_paths
|
23
|
-
#{paths.flatten.inspect}
|
24
|
-
end
|
25
|
-
}
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,153 +0,0 @@
|
|
1
|
-
class Lono::AppFile::Build::LambdaLayer
|
2
|
-
# Based on jets
|
3
|
-
class RubyPackager
|
4
|
-
include Lono::Utils::Rsync
|
5
|
-
|
6
|
-
def initialize(blueprint, registry_item)
|
7
|
-
@blueprint, @registry_item = blueprint, registry_item
|
8
|
-
|
9
|
-
@registry_name = @registry_item.name.sub(/\/$/,'')
|
10
|
-
@app_root = "#{Lono.blueprint_root}/app/files/#{@registry_name}"
|
11
|
-
end
|
12
|
-
|
13
|
-
def build
|
14
|
-
return unless gemfile_exist?
|
15
|
-
|
16
|
-
bundle_install
|
17
|
-
package
|
18
|
-
end
|
19
|
-
|
20
|
-
# We consolidate all gems to opt
|
21
|
-
def package
|
22
|
-
setup_bundle_config(output_area)
|
23
|
-
# copy_cache_gems # TODO: might not need this cache
|
24
|
-
consolidate_gems_to_opt
|
25
|
-
end
|
26
|
-
|
27
|
-
# Also restructure the folder from:
|
28
|
-
# vendor/gems/ruby/2.5.0
|
29
|
-
# To:
|
30
|
-
# ruby/gems/2.5.0
|
31
|
-
#
|
32
|
-
# For Lambda Layer structure
|
33
|
-
def consolidate_gems_to_opt
|
34
|
-
src = "#{cache_area}/vendor/gems/ruby/#{ruby_folder}"
|
35
|
-
dest = "#{opt_area}/ruby/gems/#{ruby_folder}"
|
36
|
-
rsync_and_link(src, dest)
|
37
|
-
end
|
38
|
-
|
39
|
-
def rsync_and_link(src, dest)
|
40
|
-
FileUtils.mkdir_p(dest)
|
41
|
-
rsync(src, dest)
|
42
|
-
|
43
|
-
# create symlink in output path not the cache path
|
44
|
-
symlink_dest = "#{output_area}/vendor/gems/ruby/#{ruby_folder}"
|
45
|
-
puts "symlink_dest #{symlink_dest}"
|
46
|
-
FileUtils.rm_rf(symlink_dest) # blow away original 2.5.0 folder
|
47
|
-
|
48
|
-
# Create symlink that will point to the gems in the Lambda Layer:
|
49
|
-
# stage/opt/ruby/gems/2.5.0 -> /opt/ruby/gems/2.5.0
|
50
|
-
FileUtils.mkdir_p(File.dirname(symlink_dest))
|
51
|
-
FileUtils.ln_sf("/opt/ruby/gems/#{ruby_folder}", symlink_dest)
|
52
|
-
end
|
53
|
-
|
54
|
-
def ruby_folder
|
55
|
-
major, minor, _ = RUBY_VERSION.split('.')
|
56
|
-
[major, minor, '0'].join('.') # 2.5.1 => 2.5.0
|
57
|
-
end
|
58
|
-
|
59
|
-
# Installs gems on the current target system: both compiled and non-compiled.
|
60
|
-
# If user is on a macosx machine, macosx gems will be installed.
|
61
|
-
# If user is on a linux machine, linux gems will be installed.
|
62
|
-
#
|
63
|
-
# Copies Gemfile* to /tmp/jets/demo/cache folder and installs
|
64
|
-
# gems with bundle install from there.
|
65
|
-
#
|
66
|
-
# We take the time to copy Gemfile and bundle into a separate directory
|
67
|
-
# because it gets left around to act as a 'cache'. So, when the builds the
|
68
|
-
# project gets built again not all the gems from get installed from the
|
69
|
-
# beginning.
|
70
|
-
def bundle_install
|
71
|
-
puts "Bundling: running bundle install in cache area: #{cache_area}."
|
72
|
-
|
73
|
-
rsync(output_area, cache_area)
|
74
|
-
|
75
|
-
# Uncomment out to always remove the cache/vendor/gems to debug
|
76
|
-
# FileUtils.rm_rf("#{cache_area}/vendor/gems")
|
77
|
-
|
78
|
-
# Remove .bundle folder so .bundle/config doesnt affect how gems are packages
|
79
|
-
# Not using BUNDLE_IGNORE_CONFIG=1 to allow home ~/.bundle/config to affect bundling though.
|
80
|
-
# This is useful if you have private gems sources that require authentication. Example:
|
81
|
-
#
|
82
|
-
# bundle config gems.myprivatesource.com user:pass
|
83
|
-
#
|
84
|
-
|
85
|
-
FileUtils.rm_rf("#{cache_area}/.bundle")
|
86
|
-
require "bundler" # dynamically require bundler so user can use any bundler
|
87
|
-
setup_bundle_config(cache_area)
|
88
|
-
Bundler.with_unbundled_env do
|
89
|
-
sh "cd #{cache_area} && env bundle install"
|
90
|
-
end
|
91
|
-
|
92
|
-
remove_bundled_with("#{cache_area}/Gemfile.lock")
|
93
|
-
# Fixes really tricky bug where Gemfile and Gemfile.lock is out-of-sync. Details: https://gist.github.com/tongueroo/b5b0d0c924a4a1633eee514795e4b04b
|
94
|
-
FileUtils.cp("#{cache_area}/Gemfile.lock", "#{Lono.config.output_path}/#{@blueprint}/files/#{@registry_name}/Gemfile.lock")
|
95
|
-
|
96
|
-
puts 'Bundle install success.'
|
97
|
-
end
|
98
|
-
|
99
|
-
# Remove the BUNDLED WITH line since we don't control the bundler gem version on AWS Lambda
|
100
|
-
# And this can cause issues with require 'bundler/setup'
|
101
|
-
def remove_bundled_with(gemfile_lock)
|
102
|
-
lines = IO.readlines(gemfile_lock)
|
103
|
-
|
104
|
-
# amount is the number of lines to remove
|
105
|
-
new_lines, capture, count, amount = [], true, 0, 2
|
106
|
-
lines.each do |l|
|
107
|
-
capture = false if l.include?('BUNDLED WITH')
|
108
|
-
if capture
|
109
|
-
new_lines << l
|
110
|
-
end
|
111
|
-
if capture == false
|
112
|
-
count += 1
|
113
|
-
capture = count > amount # renable capture
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
content = new_lines.join('')
|
118
|
-
IO.write(gemfile_lock, content)
|
119
|
-
end
|
120
|
-
|
121
|
-
def setup_bundle_config(dir)
|
122
|
-
text =<<-EOL
|
123
|
-
---
|
124
|
-
BUNDLE_PATH: "vendor/gems"
|
125
|
-
BUNDLE_WITHOUT: "development:test"
|
126
|
-
EOL
|
127
|
-
bundle_config = "#{dir}/.bundle/config"
|
128
|
-
FileUtils.mkdir_p(File.dirname(bundle_config))
|
129
|
-
IO.write(bundle_config, text)
|
130
|
-
end
|
131
|
-
|
132
|
-
def output_area
|
133
|
-
"#{Lono.config.output_path}/#{@blueprint}/files/#{@registry_name}"
|
134
|
-
end
|
135
|
-
|
136
|
-
def build_area
|
137
|
-
"#{Lono.config.output_path}/#{@blueprint}/lambda_layers/#{@registry_name}"
|
138
|
-
end
|
139
|
-
|
140
|
-
def cache_area
|
141
|
-
"#{build_area}/cache"
|
142
|
-
end
|
143
|
-
|
144
|
-
def opt_area
|
145
|
-
"#{build_area}/opt"
|
146
|
-
end
|
147
|
-
|
148
|
-
def gemfile_exist?
|
149
|
-
gemfile_path = "#{@app_root}/Gemfile"
|
150
|
-
File.exist?(gemfile_path)
|
151
|
-
end
|
152
|
-
end
|
153
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
class Lono::AppFile::Build
|
2
|
-
class LambdaLayer
|
3
|
-
def initialize(blueprint, registry_item)
|
4
|
-
@blueprint, @registry_item = blueprint, registry_item
|
5
|
-
end
|
6
|
-
|
7
|
-
def build
|
8
|
-
lang = @registry_item.options[:lang]
|
9
|
-
unless lang =~ /ruby/
|
10
|
-
puts "WARN: Currently only support ruby lambda layers".color(:yellow)
|
11
|
-
return
|
12
|
-
end
|
13
|
-
|
14
|
-
klass_name = "Lono::AppFile::Build::LambdaLayer::#{lang.camelize}Packager"
|
15
|
-
klass = klass_name.constantize
|
16
|
-
packager = klass.new(@blueprint, @registry_item)
|
17
|
-
packager.build
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
data/lib/lono/app_file/build.rb
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
require "thor"
|
2
|
-
|
3
|
-
module Lono::AppFile
|
4
|
-
class Build < Base
|
5
|
-
include Lono::Utils::Item::Zip
|
6
|
-
|
7
|
-
def initialize_variables
|
8
|
-
@output_files_path = "#{Lono.config.output_path}/#{@blueprint}/files"
|
9
|
-
end
|
10
|
-
|
11
|
-
def run
|
12
|
-
return unless detect_files?
|
13
|
-
puts "Building app/files for blueprint #{@blueprint}"
|
14
|
-
build_all
|
15
|
-
end
|
16
|
-
|
17
|
-
def build_all
|
18
|
-
clean_output
|
19
|
-
validate_files!
|
20
|
-
copy_to_output
|
21
|
-
build_layers
|
22
|
-
compress_output
|
23
|
-
end
|
24
|
-
|
25
|
-
def validate_files!
|
26
|
-
items = Registry.items + Registry.layers
|
27
|
-
missing = items.select do |item|
|
28
|
-
!File.exist?(item.src_path)
|
29
|
-
end
|
30
|
-
missing_paths = missing.map { |item| item.src_path }.uniq
|
31
|
-
unless missing_paths.empty?
|
32
|
-
puts "ERROR: These app/files are missing were used by the s3_key method but are missing".color(:red)
|
33
|
-
missing_paths.each do |path|
|
34
|
-
puts " #{path}"
|
35
|
-
end
|
36
|
-
puts "Please double check that they exist."
|
37
|
-
exit 1
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def build_layers
|
42
|
-
layer_items = Registry.layers
|
43
|
-
layer_items.each do |item|
|
44
|
-
LambdaLayer.new(@blueprint, item).build
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def compress_output
|
49
|
-
Registry.items.each do |item|
|
50
|
-
# type can be lambda_layer or file
|
51
|
-
if item.type == "lambda_layer" || item.exist?
|
52
|
-
zip(item)
|
53
|
-
else
|
54
|
-
puts "WARN: #{item.src_path} does not exist. Double check that the path is correct in the s3_key call.".color(:yellow)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
def copy_to_output
|
60
|
-
override_source_paths("#{Lono.blueprint_root}/app/files")
|
61
|
-
self.destination_root = @output_files_path
|
62
|
-
directory(".", verbose: false, context: context.get_binding) # Thor::Action
|
63
|
-
end
|
64
|
-
|
65
|
-
def context
|
66
|
-
Lono::Template::Context.new(@options)
|
67
|
-
end
|
68
|
-
memoize :context
|
69
|
-
|
70
|
-
def clean_output
|
71
|
-
FileUtils.rm_rf(@output_files_path)
|
72
|
-
end
|
73
|
-
|
74
|
-
def detect_files?
|
75
|
-
app_files = Dir["#{Lono.blueprint_root}/app/files/*"]
|
76
|
-
if app_files.empty?
|
77
|
-
false
|
78
|
-
else
|
79
|
-
puts "Detected app/files for blueprint #{@blueprint}"
|
80
|
-
true
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
class Lono::AppFile::Registry
|
2
|
-
# Holds metadata about the item in the regsitry.
|
3
|
-
class Item
|
4
|
-
include Lono::Utils::Item::FileMethods
|
5
|
-
|
6
|
-
attr_reader :name, :options, :type
|
7
|
-
def initialize(name, blueprint, options={})
|
8
|
-
@name, @blueprint, @options = name, blueprint, options
|
9
|
-
@type = options[:type] || "file"
|
10
|
-
end
|
11
|
-
|
12
|
-
def src_path
|
13
|
-
"#{Lono.blueprint_root}/app/files/#{@name}"
|
14
|
-
end
|
15
|
-
|
16
|
-
def output_path
|
17
|
-
if @type == "file"
|
18
|
-
"#{Lono.root}/output/#{@blueprint}/files/#{@name}"
|
19
|
-
else
|
20
|
-
"#{Lono.root}/output/#{@blueprint}/lambda_layers/#{@name}/opt"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Lono::AppFile
|
2
|
-
class Registry
|
3
|
-
cattr_reader :items
|
4
|
-
@@items = []
|
5
|
-
|
6
|
-
class << self
|
7
|
-
def register(name, blueprint, options={})
|
8
|
-
@@items << Item.new(name, blueprint, options) unless @@items.detect { |i| i.name == name && i.type == options[:type] }
|
9
|
-
end
|
10
|
-
|
11
|
-
def layers
|
12
|
-
@@items.select { |i| i.type == "lambda_layer" }
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
data/lib/lono/app_file/upload.rb
DELETED
@@ -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,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
|