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/plugin.rb
ADDED
data/lib/lono/s3/aws_setup.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
|
1
|
+
module Lono::S3
|
2
2
|
class AwsSetup
|
3
3
|
include Lono::AwsServices
|
4
|
+
include Lono::Utils::Logging
|
4
5
|
|
5
6
|
def check!
|
6
7
|
s3.config.region
|
7
8
|
rescue Aws::Errors::MissingRegionError => e
|
8
|
-
|
9
|
-
|
9
|
+
logger.info "ERROR: #{e.class}: #{e.message}".color(:red)
|
10
|
+
logger.info <<~EOL
|
10
11
|
Unable to detect the AWS_REGION to make AWS API calls. This is might be because the AWS access
|
11
12
|
has not been set up yet. Please either your ~/.aws files.
|
12
13
|
EOL
|
data/lib/lono/s3/bucket.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
|
1
|
+
module Lono::S3
|
2
2
|
class Bucket
|
3
3
|
STACK_NAME = ENV['LONO_STACK_NAME'] || "lono"
|
4
4
|
include Lono::AwsServices
|
5
|
+
include Lono::Utils::Logging
|
5
6
|
extend Lono::AwsServices
|
6
7
|
extend Memoist
|
7
8
|
|
@@ -15,8 +16,8 @@ class Lono::S3
|
|
15
16
|
stack = new.find_stack
|
16
17
|
return unless stack
|
17
18
|
|
18
|
-
|
19
|
-
bucket =
|
19
|
+
stack_resources = find_stack_resources(STACK_NAME)
|
20
|
+
bucket = stack_resources.find { |r| r.logical_resource_id == "Bucket" }
|
20
21
|
@@name = bucket.physical_resource_id # actual bucket name
|
21
22
|
end
|
22
23
|
|
@@ -30,9 +31,8 @@ class Lono::S3
|
|
30
31
|
end
|
31
32
|
|
32
33
|
def deploy
|
33
|
-
|
34
|
-
|
35
|
-
puts "Existing '#{STACK_NAME}' stack in ROLLBACK_COMPLETE state. Deleting stack before continuing."
|
34
|
+
if rollback.complete?
|
35
|
+
logger.info "Existing '#{STACK_NAME}' stack in ROLLBACK_COMPLETE state. Deleting stack before continuing."
|
36
36
|
cfn.delete_stack(stack_name: STACK_NAME)
|
37
37
|
status.wait
|
38
38
|
status.reset
|
@@ -56,15 +56,15 @@ class Lono::S3
|
|
56
56
|
|
57
57
|
def show
|
58
58
|
if bucket_name
|
59
|
-
|
59
|
+
logger.info "Lono bucket name: #{bucket_name}"
|
60
60
|
else
|
61
|
-
|
61
|
+
logger.info "Lono bucket does not exist yet."
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
65
|
# Launches a cloudformation to create an s3 bucket
|
66
66
|
def create
|
67
|
-
|
67
|
+
logger.info "Creating #{STACK_NAME} stack for s3 bucket to store templates"
|
68
68
|
cfn.create_stack(
|
69
69
|
stack_name: STACK_NAME,
|
70
70
|
template_body: template_body,
|
@@ -73,13 +73,13 @@ class Lono::S3
|
|
73
73
|
success = status.wait
|
74
74
|
status.reset
|
75
75
|
unless success
|
76
|
-
|
76
|
+
logger.info "ERROR: Unable to create lono stack with managed s3 bucket".color(:red)
|
77
77
|
exit 1
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
81
|
def update
|
82
|
-
|
82
|
+
logger.info "Updating #{STACK_NAME} stack with the s3 bucket"
|
83
83
|
cfn.update_stack(stack_name: STACK_NAME, template_body: template_body)
|
84
84
|
rescue Aws::CloudFormation::Errors::ValidationError => e
|
85
85
|
raise unless e.message.include?("No updates are to be performed")
|
@@ -88,7 +88,7 @@ class Lono::S3
|
|
88
88
|
def delete
|
89
89
|
are_you_sure?
|
90
90
|
|
91
|
-
|
91
|
+
logger.info "Deleting #{STACK_NAME} stack with the s3 bucket"
|
92
92
|
disable_termination_protect
|
93
93
|
empty_bucket!
|
94
94
|
cfn.delete_stack(stack_name: STACK_NAME)
|
@@ -135,18 +135,18 @@ class Lono::S3
|
|
135
135
|
|
136
136
|
|
137
137
|
def are_you_sure?
|
138
|
-
return true if @options[:
|
138
|
+
return true if @options[:yes]
|
139
139
|
|
140
140
|
if bucket_name.nil?
|
141
|
-
|
141
|
+
logger.info "The lono stack and s3 bucket does not exist."
|
142
142
|
exit
|
143
143
|
end
|
144
144
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
unless
|
149
|
-
|
145
|
+
logger.info "Are you yes you want the lono bucket #{bucket_name.color(:green)} to be emptied and deleted? (y/N)"
|
146
|
+
yes = $stdin.gets.strip
|
147
|
+
confirmed = yes =~ /^Y/i
|
148
|
+
unless confirmed
|
149
|
+
logger.info "Phew that was close."
|
150
150
|
exit
|
151
151
|
end
|
152
152
|
end
|
data/lib/lono/s3/uploader.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
|
1
|
+
module Lono::S3
|
2
2
|
class Uploader
|
3
|
-
include Lono::AwsServices
|
4
3
|
extend Memoist
|
4
|
+
include Lono::AwsServices
|
5
|
+
include Lono::Utils::Logging
|
5
6
|
|
6
7
|
attr_reader :path
|
7
8
|
def initialize(path, options={})
|
@@ -14,33 +15,30 @@ class Lono::S3
|
|
14
15
|
# path: can be full path or relative path
|
15
16
|
#
|
16
17
|
def upload
|
17
|
-
return if @options[:noop] || ENV['LONO_TEST'] == '1'
|
18
|
-
|
19
18
|
path = @path.gsub("#{Lono.root}/",'') # remove Lono.root
|
20
19
|
key = "#{Lono.env}/#{path}"
|
21
20
|
|
22
21
|
pretty_path = path.sub(/^\.\//, '')
|
23
|
-
|
22
|
+
s3_path = "s3://#{s3_bucket}/#{key}"
|
24
23
|
|
25
|
-
local_checksum = Digest::MD5.hexdigest(IO.read(path))
|
24
|
+
local_checksum = Digest::MD5.hexdigest(IO.read(@path))
|
26
25
|
remote_checksum = remote_checksum(key)
|
27
26
|
if local_checksum == remote_checksum
|
28
|
-
|
27
|
+
logger.debug "Not modified: #{pretty_path} to #{s3_path}"
|
29
28
|
return # do not upload unless the checksum has changed
|
30
29
|
else
|
31
30
|
# Example output:
|
32
31
|
# Uploaded: app/files/docker.yml to s3://boltops-dev/s3_folder/templates/development/docker.yml
|
33
32
|
# Uploaded: app/files/ecs/private.yml to s3://boltops-dev/s3_folder/templates/development/ecs/private.yml
|
34
|
-
message = "Uploading
|
35
|
-
|
36
|
-
puts message
|
33
|
+
message = "Uploading #{pretty_path} to #{s3_path}"
|
34
|
+
logger.debug message
|
37
35
|
end
|
38
36
|
|
39
37
|
s3.put_object(
|
40
|
-
body: IO.read(path),
|
38
|
+
body: IO.read(@path),
|
41
39
|
bucket: s3_bucket,
|
42
40
|
key: key,
|
43
|
-
)
|
41
|
+
)
|
44
42
|
end
|
45
43
|
|
46
44
|
# https://s3.amazonaws.com/mybucket/development/output/blueprint/templates/blueprint.yml
|
data/lib/lono/script/base.rb
CHANGED
data/lib/lono/script/build.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "digest"
|
2
2
|
require "fileutils"
|
3
3
|
|
4
|
-
|
4
|
+
module Lono::Script
|
5
5
|
class Build < Base
|
6
6
|
# Only avaialble after script has been built.
|
7
7
|
def self.scripts_name
|
@@ -9,18 +9,17 @@ class Lono::Script
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def run
|
12
|
-
Lono::ProjectChecker.check
|
13
12
|
reset
|
14
|
-
if Dir["#{
|
13
|
+
if Dir["#{@blueprint.root}/scripts/*"].empty?
|
15
14
|
return
|
16
15
|
else
|
17
|
-
|
16
|
+
logger.info "Detected scripts"
|
18
17
|
end
|
19
18
|
|
20
|
-
|
19
|
+
logger.info "Tarballing scripts folder to scripts.tgz"
|
21
20
|
tarball_path = create_tarball
|
22
21
|
save_scripts_info(tarball_path)
|
23
|
-
|
22
|
+
logger.info "Tarball created at #{tarball_path}"
|
24
23
|
end
|
25
24
|
|
26
25
|
# Only avaialble after script has been built.
|
@@ -35,12 +34,12 @@ class Lono::Script
|
|
35
34
|
def create_tarball
|
36
35
|
# https://apple.stackexchange.com/questions/14980/why-are-dot-underscore-files-created-and-how-can-i-avoid-them
|
37
36
|
# using system to avoid displaying command
|
38
|
-
system "cd #{
|
37
|
+
system "cd #{@blueprint.root} && dot_clean ." if system("type dot_clean > /dev/null 2>&1")
|
39
38
|
|
40
39
|
# https://serverfault.com/questions/110208/different-md5sums-for-same-tar-contents
|
41
40
|
# Using tar czf directly results in a new m5sum each time because the gzip
|
42
41
|
# timestamp is included. So using: tar -c ... | gzip -n
|
43
|
-
sh "cd #{
|
42
|
+
sh "cd #{@blueprint.root} && tar -c scripts | gzip -n > scripts.tgz" # temporary scripts.tgz file
|
44
43
|
|
45
44
|
rename_with_md5!
|
46
45
|
end
|
@@ -48,9 +47,9 @@ class Lono::Script
|
|
48
47
|
# Apppend a md5 to file after it's been created and moves it to
|
49
48
|
# output/scripts/scripts-[MD5].tgz
|
50
49
|
def rename_with_md5!
|
51
|
-
md5_path = "output/#{@blueprint}/scripts/scripts-#{md5sum}.tgz"
|
50
|
+
md5_path = "output/#{@blueprint.name}/scripts/scripts-#{md5sum}.tgz"
|
52
51
|
FileUtils.mkdir_p(File.dirname(md5_path))
|
53
|
-
FileUtils.mv("#{
|
52
|
+
FileUtils.mv("#{@blueprint.root}/scripts.tgz", md5_path)
|
54
53
|
md5_path
|
55
54
|
end
|
56
55
|
|
@@ -61,11 +60,11 @@ class Lono::Script
|
|
61
60
|
|
62
61
|
# cache this because the file will get removed
|
63
62
|
def md5sum
|
64
|
-
@md5sum ||= Digest::MD5.file("#{
|
63
|
+
@md5sum ||= Digest::MD5.file("#{@blueprint.root}/scripts.tgz").to_s[0..7]
|
65
64
|
end
|
66
65
|
|
67
66
|
def sh(command)
|
68
|
-
|
67
|
+
logger.info "=> #{command}"
|
69
68
|
system command
|
70
69
|
end
|
71
70
|
|
data/lib/lono/script/upload.rb
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
require "filesize"
|
2
2
|
|
3
|
-
|
3
|
+
module Lono::Script
|
4
4
|
class Upload < Base
|
5
5
|
include Lono::AwsServices
|
6
|
-
include Lono::Utils::
|
6
|
+
include Lono::Utils::Pretty
|
7
|
+
include Lono::Utils::Logging
|
7
8
|
|
8
9
|
def run
|
9
|
-
Lono::ProjectChecker.check
|
10
10
|
return unless scripts_built?
|
11
11
|
|
12
12
|
upload(tarball_path)
|
13
|
-
|
13
|
+
logger.info "Uploaded #{File.basename(s3_dest)} to s3."
|
14
14
|
end
|
15
15
|
|
16
16
|
def upload(tarball_path)
|
17
|
-
|
17
|
+
logger.info "Uploading scripts.tgz (#{filesize}) to #{s3_dest}"
|
18
18
|
obj = s3_resource.bucket(bucket_name).object(key)
|
19
19
|
start_time = Time.now
|
20
20
|
obj.upload_file(tarball_path)
|
21
21
|
time_took = pretty_time(Time.now-start_time).color(:green)
|
22
|
-
|
22
|
+
logger.info "Time took to upload code to s3: #{time_took}"
|
23
23
|
end
|
24
24
|
|
25
25
|
def filesize
|
@@ -43,7 +43,7 @@ class Lono::Script
|
|
43
43
|
"#{Lono.env}/scripts"
|
44
44
|
end
|
45
45
|
|
46
|
-
# Scripts are only built if the
|
46
|
+
# Scripts are only built if the scripts folder is non empty
|
47
47
|
def scripts_built?
|
48
48
|
File.exist?(SCRIPTS_INFO_PATH) && !tarball_path.empty?
|
49
49
|
end
|
@@ -3,17 +3,10 @@ require "memoist"
|
|
3
3
|
require "thor"
|
4
4
|
require "yaml"
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
# variables - Returns String with content of varibles files.
|
9
|
-
# setup - Hook to do extra things like create IAM service roles.
|
10
|
-
# finish - Finish hook after config files have been created.
|
11
|
-
#
|
12
|
-
# Note there is no params method to hook. The Base class handles params well.
|
13
|
-
#
|
14
|
-
class Lono::Seed
|
15
|
-
class Base < Lono::AbstractBase
|
6
|
+
module Lono
|
7
|
+
class Seeder < Lono::CLI::Base
|
16
8
|
include Lono::AwsServices
|
9
|
+
include Lono::Cfn::Concerns::TemplateOutput
|
17
10
|
include ServiceRole
|
18
11
|
|
19
12
|
# What's needed for a Thor::Group or "Sequence"
|
@@ -28,33 +21,29 @@ class Lono::Seed
|
|
28
21
|
extend Memoist
|
29
22
|
|
30
23
|
def run
|
31
|
-
|
32
|
-
setup
|
24
|
+
build_template
|
33
25
|
self.destination_root = Dir.pwd # Thor::Actions require destination_root to be set
|
34
26
|
create_params
|
35
27
|
create_variables
|
36
|
-
finish
|
37
28
|
end
|
38
29
|
|
39
|
-
def
|
40
|
-
Lono::Template
|
30
|
+
def build_template
|
31
|
+
Lono::Builder::Template.new(@options).run
|
41
32
|
end
|
42
33
|
|
43
34
|
def create_params
|
44
|
-
return unless params
|
45
35
|
create_param_file
|
46
36
|
end
|
47
37
|
|
48
38
|
def create_param_file
|
49
|
-
|
50
|
-
|
51
|
-
puts "Template has no parameters."
|
39
|
+
if template_output.parameters.empty?
|
40
|
+
logger.info "Template has no parameters."
|
52
41
|
return
|
53
42
|
end
|
54
43
|
|
55
44
|
# Generate by parameter group first
|
56
45
|
lines, shown = [], []
|
57
|
-
|
46
|
+
template_output.parameter_groups.each do |label, parameters|
|
58
47
|
lines << "# Parameter Group: #{label}"
|
59
48
|
parameters.each do |name|
|
60
49
|
parameter_line = parameter_line(name)
|
@@ -62,20 +51,20 @@ class Lono::Seed
|
|
62
51
|
shown << name
|
63
52
|
end
|
64
53
|
lines << ""
|
65
|
-
end if
|
54
|
+
end if template_output.parameter_groups
|
66
55
|
|
67
56
|
# Then generate the rest
|
68
|
-
|
57
|
+
template_output.parameters.each do |name, data|
|
69
58
|
lines << parameter_line(name) unless shown.include?(name)
|
70
59
|
end
|
71
60
|
|
72
61
|
content = lines.join("\n")
|
73
|
-
dest_path = "
|
62
|
+
dest_path = "config/blueprints/#{@blueprint.name}/params/#{Lono.env}.txt" # only support environment level parameters for now
|
74
63
|
create_file(dest_path, content) # Thor::Action
|
75
64
|
end
|
76
65
|
|
77
66
|
def parameter_line(name)
|
78
|
-
data =
|
67
|
+
data = template_output.parameters[name]
|
79
68
|
example = description_example(data["Description"])
|
80
69
|
if data["Default"].nil?
|
81
70
|
line = "#{name}=#{example} # (required)"
|
@@ -94,23 +83,19 @@ class Lono::Seed
|
|
94
83
|
md[2]
|
95
84
|
end
|
96
85
|
|
97
|
-
def
|
98
|
-
|
86
|
+
def self.source_root
|
87
|
+
Lono.root
|
99
88
|
end
|
100
89
|
|
101
90
|
def create_variables
|
102
|
-
|
103
|
-
|
104
|
-
|
91
|
+
src = "#{@blueprint.root}/seed/vars"
|
92
|
+
dest = "#{Lono.root}/config/blueprints/#{@blueprint.name}/vars"
|
93
|
+
directory(src, dest) if File.exist?(src)
|
105
94
|
end
|
106
95
|
|
107
|
-
|
108
|
-
def
|
109
|
-
|
110
|
-
# Meant to be overriden by subclass
|
111
|
-
# Return String with contents of variables file.
|
112
|
-
def variables
|
113
|
-
false
|
96
|
+
private
|
97
|
+
def env
|
98
|
+
Lono.env # allows for seed/vars/%env%.rb.tt
|
114
99
|
end
|
115
100
|
end
|
116
101
|
end
|
data/lib/lono/user_data.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
module Lono
|
2
2
|
# This class is not use by lono internally. It is really only meant to be
|
3
|
-
# exposed to the lono
|
4
|
-
#
|
3
|
+
# exposed to the lono user_data command so users can debug their generated
|
4
|
+
# user_data scripts. It is useful for debugging.
|
5
5
|
#
|
6
|
-
# Normally, the Lono::Erb#run method generates the CloudFormation
|
6
|
+
# Normally, the Lono::Erb#run method generates the CloudFormation template
|
7
7
|
# and embeds user-data script into the template.
|
8
|
-
class UserData <
|
8
|
+
class UserData < Lono::CLI::Base
|
9
9
|
def initialize(options={})
|
10
10
|
super
|
11
11
|
@name = options[:name]
|
@@ -13,19 +13,14 @@ module Lono
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def generate
|
16
|
-
|
16
|
+
pretty_path = pretty_path(@path)
|
17
|
+
logger.info "Building user_data for '#{@name}' at #{pretty_path}"
|
17
18
|
if File.exist?(@path)
|
18
|
-
|
19
|
+
logger.info RenderMePretty.result(@path, context: context)
|
19
20
|
else
|
20
|
-
|
21
|
+
logger.info "ERROR: #{pretty_path} does not exist".color(:red)
|
21
22
|
exit 1
|
22
23
|
end
|
23
24
|
end
|
24
|
-
|
25
|
-
# Context for ERB rendering.
|
26
|
-
# This is where we control what references get passed to the ERB rendering.
|
27
|
-
def context
|
28
|
-
@context ||= Lono::Template::Context.new(@options)
|
29
|
-
end
|
30
25
|
end
|
31
26
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Lono::Utils
|
2
|
+
module Context
|
3
|
+
extend Memoist
|
4
|
+
|
5
|
+
def context
|
6
|
+
Lono::Builder::Context.new(@options)
|
7
|
+
end
|
8
|
+
memoize :context
|
9
|
+
|
10
|
+
def params_context
|
11
|
+
Lono::Builder::Context::Params.new(@options)
|
12
|
+
end
|
13
|
+
memoize :params_context
|
14
|
+
end
|
15
|
+
end
|
data/lib/lono/utils/item/zip.rb
CHANGED
@@ -14,7 +14,7 @@ module Lono::Utils::Item
|
|
14
14
|
path = item.output_path
|
15
15
|
zip_file = item.zip_file_name
|
16
16
|
|
17
|
-
|
17
|
+
logger.info "Zipping file and generating md5 named file from: #{path}"
|
18
18
|
command = "cd #{File.dirname(path)} && zip -q #{zip_file} #{File.basename(path)}" # create zipfile at same level of file
|
19
19
|
execute_zip(command)
|
20
20
|
end
|
@@ -23,18 +23,18 @@ module Lono::Utils::Item
|
|
23
23
|
path = item.output_path
|
24
24
|
zip_file = item.zip_file_name
|
25
25
|
|
26
|
-
|
26
|
+
logger.info "Zipping folder and generating md5 named file from: #{path}"
|
27
27
|
command = "cd #{path} && zip --symlinks -rq #{zip_file} ." # create zipfile witih directory
|
28
28
|
execute_zip(command)
|
29
29
|
FileUtils.mv("#{path}/#{zip_file}", "#{File.dirname(path)}/#{zip_file}") # move zip back to the parent directory
|
30
30
|
end
|
31
31
|
|
32
32
|
def execute_zip(command)
|
33
|
-
#
|
33
|
+
# logger.info "=> #{command}".color(:green) # uncomment to debug
|
34
34
|
`#{command}`
|
35
35
|
unless $?.success?
|
36
|
-
|
37
|
-
|
36
|
+
logger.info "ERROR: Fail to run #{command}".color(:red)
|
37
|
+
logger.info "Maybe zip is not installed or path is incorrect?"
|
38
38
|
exit 1
|
39
39
|
end
|
40
40
|
end
|
@@ -1,5 +1,9 @@
|
|
1
1
|
module Lono::Utils
|
2
|
-
module
|
2
|
+
module Pretty
|
3
|
+
def pretty_path(path)
|
4
|
+
path.sub("#{Lono.root}/",'')
|
5
|
+
end
|
6
|
+
|
3
7
|
# http://stackoverflow.com/questions/4175733/convert-duration-to-hoursminutesseconds-or-similar-in-rails-3-or-ruby
|
4
8
|
def pretty_time(total_seconds)
|
5
9
|
minutes = (total_seconds / 60) % 60
|
@@ -11,4 +15,4 @@ module Lono::Utils
|
|
11
15
|
end
|
12
16
|
end
|
13
17
|
end
|
14
|
-
end
|
18
|
+
end
|
data/lib/lono/utils/rsync.rb
CHANGED
@@ -2,10 +2,12 @@ require 'shellwords'
|
|
2
2
|
|
3
3
|
module Lono::Utils
|
4
4
|
module Rsync
|
5
|
+
include Lono::Utils::Logging
|
6
|
+
|
5
7
|
def sh(command)
|
6
|
-
|
8
|
+
logger.info "=> #{command}"
|
7
9
|
out = `#{command}`
|
8
|
-
|
10
|
+
logger.info out if ENV['LONO_DEBUG_SH']
|
9
11
|
success = $?.success?
|
10
12
|
raise("ERROR: running command #{command}").color(:red) unless success
|
11
13
|
success
|
data/lib/lono/utils/sure.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Lono::Utils
|
2
2
|
module Sure
|
3
3
|
def sure?(message, desc=nil)
|
4
|
-
if @options[:
|
5
|
-
|
4
|
+
if @options[:yes]
|
5
|
+
yes = 'y'
|
6
6
|
else
|
7
7
|
out = message
|
8
8
|
if desc
|
@@ -11,10 +11,10 @@ module Lono::Utils
|
|
11
11
|
out += " (y/N) "
|
12
12
|
end
|
13
13
|
print out
|
14
|
-
|
14
|
+
yes = $stdin.gets
|
15
15
|
end
|
16
16
|
|
17
|
-
unless
|
17
|
+
unless yes =~ /^y/
|
18
18
|
puts "Whew! Exiting."
|
19
19
|
exit 0
|
20
20
|
end
|
data/lib/lono/version.rb
CHANGED
data/lib/lono.rb
CHANGED
@@ -1,35 +1,30 @@
|
|
1
1
|
$stdout.sync = true unless ENV["LONO_STDOUT_SYNC"] == "0"
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'active_support'
|
4
|
+
require 'active_support/core_ext/class'
|
5
5
|
require 'active_support/core_ext/hash'
|
6
6
|
require 'active_support/core_ext/string'
|
7
7
|
require 'aws_data'
|
8
8
|
require 'cfn_camelizer'
|
9
|
+
require 'cfn_status'
|
10
|
+
require 'cli-format'
|
11
|
+
require 'dsl_evaluator'
|
9
12
|
require 'fileutils'
|
10
13
|
require 'json'
|
11
14
|
require 'memoist'
|
12
15
|
require 'plissken'
|
13
16
|
require 'rainbow/ext/string'
|
14
17
|
require 'render_me_pretty'
|
18
|
+
require 'singleton'
|
15
19
|
require 'yaml'
|
16
20
|
|
17
|
-
gem_root = File.dirname(__dir__)
|
18
|
-
$:.unshift("#{gem_root}/lib")
|
19
|
-
$:.unshift("#{gem_root}/vendor/cfn-status/lib")
|
20
|
-
require "cfn_status"
|
21
|
-
|
22
|
-
require "lono/ext/bundler"
|
23
|
-
|
24
21
|
require "lono/autoloader"
|
25
22
|
Lono::Autoloader.setup
|
26
23
|
|
27
24
|
module Lono
|
28
25
|
API_DEFAULT = 'https://api.lono.cloud/v1'
|
29
26
|
API = ENV['LONO_API'] || API_DEFAULT
|
30
|
-
|
31
27
|
extend Core
|
32
28
|
end
|
33
29
|
|
34
|
-
Lono.
|
35
|
-
Lono.lono_pro_removal_check!
|
30
|
+
Lono::Booter.boot
|
File without changes
|
@@ -0,0 +1,9 @@
|
|
1
|
+
parameter("BucketName", Conditional: true)
|
2
|
+
parameter("AccessControl", Default: "Private")
|
3
|
+
|
4
|
+
resource("Bucket", "AWS::S3::Bucket",
|
5
|
+
BucketName: ref("BucketName", Conditional: true),
|
6
|
+
AccessControl: ref("AccessControl"),
|
7
|
+
)
|
8
|
+
|
9
|
+
output("BucketName", ref("Bucket"))
|