lono 6.1.11 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.cody/acceptance.sh +19 -3
- data/.gitignore +2 -2
- data/CHANGELOG.md +16 -1
- data/README.md +18 -20
- data/Rakefile +1 -0
- data/lib/lono.rb +7 -5
- data/lib/lono/abstract_base.rb +25 -0
- data/lib/lono/api/client.rb +30 -0
- data/lib/lono/api/proxy.rb +58 -0
- data/lib/lono/api/repos.rb +8 -0
- data/lib/lono/api/verify.rb +13 -0
- data/lib/lono/app_file/base.rb +4 -11
- data/lib/lono/app_file/build.rb +1 -1
- data/lib/lono/app_file/upload.rb +1 -4
- data/lib/lono/autoloader.rb +3 -1
- data/lib/lono/aws_services.rb +9 -9
- data/lib/lono/aws_services/helper.rb +14 -0
- data/lib/lono/aws_services/{util.rb → stack.rb} +1 -9
- data/lib/lono/aws_services/stack_set.rb +41 -0
- data/lib/lono/blueprint.rb +2 -2
- data/lib/lono/blueprint/configset/loader.rb +7 -0
- data/lib/lono/blueprint/helper.rb +8 -2
- data/lib/lono/blueprint/meta.rb +4 -12
- data/lib/lono/blueprint/new.rb +3 -3
- data/lib/lono/blueprint/root.rb +6 -26
- data/lib/lono/bundle.rb +54 -0
- data/lib/lono/cfn.rb +31 -75
- data/lib/lono/cfn/base.rb +39 -136
- data/lib/lono/cfn/cancel.rb +14 -9
- data/lib/lono/cfn/create.rb +15 -19
- data/lib/lono/cfn/delete.rb +9 -9
- data/lib/lono/cfn/deploy.rb +4 -4
- data/lib/lono/cfn/download.rb +27 -9
- data/lib/lono/cfn/opts.rb +80 -0
- data/lib/lono/cfn/preview/changeset.rb +23 -23
- data/lib/lono/cfn/preview/codediff.rb +5 -6
- data/lib/lono/cfn/preview/param.rb +10 -10
- data/lib/lono/cfn/rollback.rb +5 -5
- data/lib/lono/cfn/status.rb +0 -10
- data/lib/lono/cfn/update.rb +22 -27
- data/lib/lono/clean.rb +3 -3
- data/lib/lono/cli.rb +69 -34
- data/lib/lono/code.rb +22 -0
- data/lib/lono/command.rb +7 -0
- data/lib/lono/config_location.rb +6 -13
- data/lib/lono/configset.rb +9 -0
- data/lib/lono/configset/combiner.rb +128 -0
- data/lib/lono/configset/evaluate_file.rb +8 -0
- data/lib/lono/configset/list.rb +67 -0
- data/lib/lono/configset/loader.rb +98 -0
- data/lib/lono/configset/loader/dsl.rb +9 -0
- data/lib/lono/configset/materializer/final.rb +10 -0
- data/lib/lono/configset/materializer/gems_builder.rb +81 -0
- data/lib/lono/configset/materializer/jade.rb +15 -0
- data/lib/lono/configset/materializer/source.rb +54 -0
- data/lib/lono/configset/meta.rb +19 -0
- data/lib/lono/configset/meta/dsl.rb +12 -0
- data/lib/lono/configset/new.rb +84 -0
- data/lib/lono/configset/preparer.rb +44 -0
- data/lib/lono/configset/register/base.rb +121 -0
- data/lib/lono/configset/register/blueprint.rb +16 -0
- data/lib/lono/configset/register/dsl.rb +15 -0
- data/lib/lono/configset/register/project.rb +12 -0
- data/lib/lono/configset/registry.rb +34 -0
- data/lib/lono/configset/resolver.rb +42 -0
- data/lib/lono/conventions.rb +18 -7
- data/lib/lono/core.rb +16 -20
- data/lib/lono/default/settings.yml +2 -3
- data/lib/lono/ext/bundler.rb +7 -0
- data/lib/lono/file_uploader.rb +8 -5
- data/lib/lono/finder/base.rb +140 -0
- data/lib/lono/finder/blueprint.rb +11 -0
- data/lib/lono/finder/blueprint/configset.rb +17 -0
- data/lib/lono/finder/configset.rb +11 -0
- data/lib/lono/generate.rb +93 -0
- data/lib/lono/help/blueprint/new.md +0 -1
- data/lib/lono/help/cfn/delete.md +1 -1
- data/lib/lono/help/cfn/deploy.md +5 -76
- data/lib/lono/help/cfn/status.md +0 -4
- data/lib/lono/help/cfn/update.md +1 -1
- data/lib/lono/help/code/convert.md +51 -0
- data/lib/lono/help/code/import.md +30 -0
- data/lib/lono/help/configsets.md +24 -0
- data/lib/lono/help/generate.md +4 -4
- data/lib/lono/help/new.md +1 -2
- data/lib/lono/help/sets/delete.md +8 -0
- data/lib/lono/help/sets/deploy.md +76 -0
- data/lib/lono/help/sets/instances/delete.md +21 -0
- data/lib/lono/help/sets/instances/list.md +14 -0
- data/lib/lono/help/sets/instances/status.md +15 -0
- data/lib/lono/help/sets/instances/sync.md +88 -0
- data/lib/lono/help/sets/status.md +23 -0
- data/lib/lono/help/upgrade.md +1 -0
- data/lib/lono/importer.rb +22 -0
- data/lib/lono/importer/base.rb +59 -0
- data/lib/lono/importer/converter.rb +19 -0
- data/lib/lono/importer/download.rb +46 -0
- data/lib/lono/importer/dsl.rb +36 -0
- data/lib/lono/importer/erb.rb +31 -0
- data/lib/lono/importer/params.rb +56 -0
- data/lib/lono/importer/service/coder.rb +81 -0
- data/lib/lono/inspector/base.rb +12 -22
- data/lib/lono/inspector/graph.rb +1 -1
- data/lib/lono/inspector/summary.rb +41 -17
- data/lib/lono/jade.rb +103 -0
- data/lib/lono/jade/circular.rb +26 -0
- data/lib/lono/jadespec.rb +41 -0
- data/lib/lono/new.rb +2 -2
- data/lib/lono/opts.rb +43 -0
- data/lib/lono/output/template.rb +48 -0
- data/lib/lono/param.rb +3 -5
- data/lib/lono/param/generator.rb +13 -33
- data/lib/lono/pro.rb +15 -0
- data/lib/lono/pro/base.rb +16 -0
- data/lib/lono/pro/repo.rb +27 -0
- data/lib/lono/project_checker.rb +4 -29
- data/lib/lono/registration.rb +15 -0
- data/lib/lono/registration/base.rb +37 -0
- data/lib/lono/registration/check.rb +15 -0
- data/lib/lono/registration/temp.rb +60 -0
- data/lib/lono/registration/user.rb +54 -0
- data/lib/lono/script/base.rb +1 -10
- data/lib/lono/script/upload.rb +2 -12
- data/lib/lono/seed.rb +2 -11
- data/lib/lono/seed/base.rb +55 -110
- data/lib/lono/sets.rb +38 -0
- data/lib/lono/sets/base.rb +45 -0
- data/lib/lono/sets/create.rb +30 -0
- data/lib/lono/sets/delete.rb +47 -0
- data/lib/lono/sets/deploy.rb +11 -0
- data/lib/lono/sets/instances.rb +33 -0
- data/lib/lono/sets/instances/base.rb +30 -0
- data/lib/lono/sets/instances/delete.rb +69 -0
- data/lib/lono/sets/instances/list.rb +13 -0
- data/lib/lono/sets/instances/opts.rb +29 -0
- data/lib/lono/sets/instances/status.rb +12 -0
- data/lib/lono/sets/instances/sync.rb +182 -0
- data/lib/lono/sets/list.rb +35 -0
- data/lib/lono/sets/opts.rb +18 -0
- data/lib/lono/sets/preview/codediff.rb +35 -0
- data/lib/lono/sets/preview/param.rb +32 -0
- data/lib/lono/sets/status.rb +116 -0
- data/lib/lono/sets/status/instance.rb +20 -0
- data/lib/lono/sets/status/instance/base.rb +120 -0
- data/lib/lono/sets/status/instance/completed.rb +35 -0
- data/lib/lono/sets/status/instance/deleted.rb +32 -0
- data/lib/lono/sets/status/instance/show.rb +7 -0
- data/lib/lono/sets/status/instances.rb +111 -0
- data/lib/lono/sets/summarize.rb +20 -0
- data/lib/lono/sets/time_spent.rb +11 -0
- data/lib/lono/sets/update.rb +81 -0
- data/lib/lono/template.rb +5 -7
- data/lib/lono/template/configset_injector.rb +50 -0
- data/lib/lono/template/context.rb +4 -4
- data/lib/lono/template/context/loader.rb +4 -16
- data/lib/lono/template/evaluate.rb +2 -1
- data/lib/lono/template/generator.rb +17 -15
- data/lib/lono/template/helper.rb +7 -7
- data/lib/lono/template/post_processor.rb +2 -12
- data/lib/lono/template/strategy/base.rb +4 -0
- data/lib/lono/template/{dsl.rb → strategy/dsl.rb} +4 -6
- data/lib/lono/template/{dsl → strategy/dsl}/builder.rb +11 -15
- data/lib/lono/template/{dsl → strategy/dsl}/builder/fn.rb +1 -1
- data/lib/lono/template/strategy/dsl/builder/helpers.rb +11 -0
- data/lib/lono/template/strategy/dsl/builder/helpers/core_helper.rb +14 -0
- data/lib/lono/template/strategy/dsl/builder/helpers/file_helper.rb +48 -0
- data/lib/lono/template/strategy/dsl/builder/helpers/lookup_helper.rb +27 -0
- data/lib/lono/template/strategy/dsl/builder/helpers/s3_helper.rb +13 -0
- data/lib/lono/template/strategy/dsl/builder/helpers/tags_helper.rb +39 -0
- data/lib/lono/template/{dsl/builder → strategy/dsl/builder/section}/base.rb +6 -17
- data/lib/lono/template/{dsl/builder → strategy/dsl/builder/section}/condition.rb +1 -1
- data/lib/lono/template/strategy/dsl/builder/section/extensions.rb +9 -0
- data/lib/lono/template/{dsl/builder → strategy/dsl/builder/section}/mapping.rb +1 -1
- data/lib/lono/template/{dsl/builder/section_methods.rb → strategy/dsl/builder/section/methods.rb} +9 -2
- data/lib/lono/template/{dsl/builder → strategy/dsl/builder/section}/output.rb +1 -1
- data/lib/lono/template/strategy/dsl/builder/section/parameter.rb +69 -0
- data/lib/lono/template/{dsl/builder → strategy/dsl/builder/section}/resource.rb +1 -1
- data/lib/lono/template/{dsl/builder → strategy/dsl/builder/section}/resource/property_mover.rb +1 -1
- data/lib/lono/template/{dsl/builder → strategy/dsl/builder/section}/section.rb +1 -1
- data/lib/lono/template/{dsl → strategy/dsl}/builder/squeezer.rb +1 -1
- data/lib/lono/template/strategy/dsl/builder/stringify.rb +15 -0
- data/lib/lono/template/{dsl → strategy/dsl}/builder/syntax.rb +3 -2
- data/lib/lono/template/strategy/dsl/finalizer.rb +12 -0
- data/lib/lono/template/strategy/dsl/finalizer/parameter_groups.rb +56 -0
- data/lib/lono/template/{erb.rb → strategy/erb.rb} +5 -5
- data/lib/lono/template/strategy/source.rb +8 -0
- data/lib/lono/template/template.rb +1 -1
- data/lib/lono/template/upload.rb +4 -9
- data/lib/lono/template/util.rb +0 -40
- data/lib/lono/upgrade.rb +12 -10
- data/lib/lono/user_data.rb +4 -4
- data/lib/lono/utils/pretty_time.rb +14 -0
- data/lib/lono/utils/sure.rb +23 -0
- data/lib/lono/version.rb +1 -1
- data/lib/lono/yamler/loader.rb +52 -0
- data/lib/lono/yamler/validator.rb +51 -0
- data/lib/templates/blueprint/%blueprint_name%.gemspec.tt +4 -0
- data/lib/templates/blueprint/README.md.tt +1 -1
- data/lib/templates/blueprint/seed/configs.rb +2 -2
- data/lib/templates/blueprint_types/dsl/app/templates/%blueprint_name%.rb +17 -18
- data/lib/templates/blueprint_types/erb/app/templates/%blueprint_name%.yml +63 -4
- data/lib/templates/configset/%configset_name%.gemspec.tt +41 -0
- data/lib/templates/configset/.gitignore +11 -0
- data/lib/templates/configset/CHANGELOG.md +7 -0
- data/lib/templates/configset/Gemfile +4 -0
- data/lib/templates/configset/README.md.tt +3 -0
- data/lib/templates/configset/Rakefile.tt +9 -0
- data/lib/templates/configset/lib/configset.yml +20 -0
- data/lib/templates/skeleton/.gitignore +1 -0
- data/lib/templates/skeleton/Gemfile +0 -1
- data/lib/templates/skeleton/README.md +4 -4
- data/lib/templates/skeleton/configs/settings.yml +1 -1
- data/lono.gemspec +1 -4
- metadata +146 -79
- data/Guardfile +0 -19
- data/lib/lono/app_file.rb +0 -5
- data/lib/lono/blueprint/find.rb +0 -90
- data/lib/lono/blueprint/info.rb +0 -10
- data/lib/lono/blueprint/list.rb +0 -14
- data/lib/lono/cfn/current.rb +0 -95
- data/lib/lono/cfn/preview.rb +0 -4
- data/lib/lono/cfn/suffix.rb +0 -67
- data/lib/lono/cfn/util.rb +0 -27
- data/lib/lono/help/cfn/current.md +0 -18
- data/lib/lono/help/upgrade4.md +0 -25
- data/lib/lono/inspector.rb +0 -4
- data/lib/lono/output_template.rb +0 -35
- data/lib/lono/template/base.rb +0 -13
- data/lib/lono/template/dsl/builder/helpers.rb +0 -8
- data/lib/lono/template/dsl/builder/helpers/core_helper.rb +0 -107
- data/lib/lono/template/dsl/builder/helpers/param_helper.rb +0 -61
- data/lib/lono/template/dsl/builder/parameter.rb +0 -39
- data/lib/lono/upgrade/upgrade4.rb +0 -175
- data/lib/lono/upgrade/upgrade42.rb +0 -36
- data/lib/lono/upgrade/upgrade5.rb +0 -55
- data/lib/templates/blueprint/.meta/config.yml.tt +0 -4
- data/lib/templates/skeleton/Guardfile +0 -12
- data/lib/templates/upgrade5/blueprints/main/.lono/config.yml +0 -3
- data/lib/templates/upgrade5/blueprints/main/.meta/config.yml +0 -3
@@ -0,0 +1,17 @@
|
|
1
|
+
class Lono::Finder::Blueprint
|
2
|
+
class Configset < Lono::Finder::Configset
|
3
|
+
def initialize(options={})
|
4
|
+
super
|
5
|
+
@blueprint_root = options[:blueprint_root] || Lono.blueprint_root
|
6
|
+
end
|
7
|
+
|
8
|
+
def local
|
9
|
+
blueprint + vendor + gems
|
10
|
+
end
|
11
|
+
|
12
|
+
def blueprint
|
13
|
+
roots = path_roots("#{@blueprint_root}/app/#{type.pluralize}")
|
14
|
+
components(roots, "blueprint")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
module Lono
|
2
|
+
class Generate < AbstractBase
|
3
|
+
# Use class variable to cache this only runs once across all classes. base.rb, diff.rb, preview.rb
|
4
|
+
@@parameters = nil
|
5
|
+
def all
|
6
|
+
return @@parameters if @@parameters
|
7
|
+
|
8
|
+
ensure_s3_bucket_exist
|
9
|
+
pre_generate
|
10
|
+
generate_templates # generates with some placeholders for build_files IE: file://app/files/my.rb
|
11
|
+
post_generate
|
12
|
+
upload_templates
|
13
|
+
|
14
|
+
@@parameters = param_generator.generate # Writes the json file in CamelCase keys format
|
15
|
+
check_for_errors
|
16
|
+
@@parameters
|
17
|
+
end
|
18
|
+
|
19
|
+
def pre_generate
|
20
|
+
build_scripts
|
21
|
+
end
|
22
|
+
|
23
|
+
def post_generate
|
24
|
+
return if @options[:noop]
|
25
|
+
return if @options[:source]
|
26
|
+
build_files # builds app/files to output/BLUEPRINT/files
|
27
|
+
post_process_template
|
28
|
+
upload_files
|
29
|
+
upload_scripts
|
30
|
+
end
|
31
|
+
|
32
|
+
def param_generator
|
33
|
+
o = {
|
34
|
+
regenerate: true,
|
35
|
+
allow_not_exists: true,
|
36
|
+
}.merge(@options)
|
37
|
+
o = HashWithIndifferentAccess.new(o)
|
38
|
+
Lono::Param::Generator.new(o)
|
39
|
+
end
|
40
|
+
memoize :param_generator
|
41
|
+
|
42
|
+
def ensure_s3_bucket_exist
|
43
|
+
bucket = Lono::S3::Bucket.new
|
44
|
+
return if bucket.exist?
|
45
|
+
bucket.deploy
|
46
|
+
end
|
47
|
+
|
48
|
+
def build_scripts
|
49
|
+
Lono::Script::Build.new(@options).run
|
50
|
+
end
|
51
|
+
|
52
|
+
def build_files
|
53
|
+
Lono::AppFile::Build.new(@options).run
|
54
|
+
end
|
55
|
+
|
56
|
+
def generate_templates
|
57
|
+
Lono::Template::Generator.new(@options).run
|
58
|
+
end
|
59
|
+
|
60
|
+
def post_process_template
|
61
|
+
Lono::Template::PostProcessor.new(@options).run
|
62
|
+
end
|
63
|
+
|
64
|
+
def upload_templates
|
65
|
+
Lono::Template::Upload.new(@options).run
|
66
|
+
end
|
67
|
+
|
68
|
+
def upload_scripts
|
69
|
+
Lono::Script::Upload.new(@options).run
|
70
|
+
end
|
71
|
+
|
72
|
+
def upload_files
|
73
|
+
Lono::AppFile::Upload.new(@options).upload
|
74
|
+
end
|
75
|
+
|
76
|
+
def check_for_errors
|
77
|
+
errors = check_files
|
78
|
+
unless errors.empty?
|
79
|
+
puts "Please double check the command you ran. There were some errors."
|
80
|
+
puts "ERROR: #{errors.join("\n")}".color(:red)
|
81
|
+
exit
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def check_files
|
86
|
+
errors = []
|
87
|
+
unless File.exist?(template_path)
|
88
|
+
errors << "Template file missing: could not find #{template_path}"
|
89
|
+
end
|
90
|
+
errors
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
data/lib/lono/help/cfn/delete.md
CHANGED
data/lib/lono/help/cfn/deploy.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The `cfn deploy` command figures out whether or not it should perform a stack create or update. It delegates to `cfn create` or `cfn update`. This saves you from thinking about it
|
2
2
|
|
3
|
-
|
3
|
+
## Examples
|
4
4
|
|
5
5
|
Provided that you are in a lono project and have a `demo` lono blueprint that contains a `demo` template. To create a stack you can run:
|
6
6
|
|
@@ -11,82 +11,11 @@ The above command will generate:
|
|
11
11
|
* template: output/demo/templates/demo.yml
|
12
12
|
* parameters: output/demo/params/development.json
|
13
13
|
|
14
|
-
By [convention]({% link _docs/conventions/cli.md %}), the blueprint name is the same as the stack name. In turn, template name is the same as the blueprint name. Lastly, the param name will default to the template name. Some examples follow to help explain.
|
15
14
|
|
16
|
-
##
|
15
|
+
## Conventions
|
17
16
|
|
18
|
-
|
17
|
+
By [convention]({% link _docs/conventions/cli.md %}), the blueprint name is the same as the stack name. In turn, template name is the same as the blueprint name. Lastly, the param name will match the stack name unless it's explicitly specified with `--config` or `--param`.
|
19
18
|
|
20
|
-
|
21
|
-
├── blueprints
|
22
|
-
│ └── demo
|
23
|
-
│ └── app
|
24
|
-
│ └── templates
|
25
|
-
│ ├── demo.rb
|
26
|
-
│ └── ec2.rb
|
27
|
-
└── configs
|
28
|
-
└── demo
|
29
|
-
└── params
|
30
|
-
├── base.txt
|
31
|
-
└── development.txt
|
19
|
+
Often you want to create a stack name that is different from the blueprint name. Here’s an example of overriding the blueprint name.
|
32
20
|
|
33
|
-
|
34
|
-
|
35
|
-
lono cfn deploy demo
|
36
|
-
|
37
|
-
Will use:
|
38
|
-
|
39
|
-
* blueprint: blueprints/demo
|
40
|
-
* template: blueprints/demo/app/templates/demo.rb
|
41
|
-
* param: configs/demo/params/development.txt
|
42
|
-
|
43
|
-
## Stack and Blueprint Do Not Match But Everything Else Does
|
44
|
-
|
45
|
-
This is a common case, where the stack name is different from the blueprint name.
|
46
|
-
|
47
|
-
lono cfn deploy my-demo --blueprint demo
|
48
|
-
|
49
|
-
The stack will be called my-demo and the blueprint is `demo`. Since by convention, templates default to the blueprint name we're pretty much set. Lono will use:
|
50
|
-
|
51
|
-
* blueprint: blueprints/demo
|
52
|
-
* template: blueprints/demo/app/templates/demo.rb
|
53
|
-
* param: configs/demo/params/development.txt
|
54
|
-
|
55
|
-
Everything is the same as when the stack name matches the blueprint name.
|
56
|
-
|
57
|
-
## Blueprint and Template Name Do Not Match, But Template and Param Name Matches
|
58
|
-
|
59
|
-
lono cfn deploy my-demo --blueprint demo --template ec2
|
60
|
-
|
61
|
-
In this case we are using the ec2 template within the demo blueprint. We'll add another param file `configs/demo/params/ec2.txt`
|
62
|
-
|
63
|
-
└── configs
|
64
|
-
└── demo
|
65
|
-
└── params
|
66
|
-
└── ec2.txt
|
67
|
-
|
68
|
-
Lono will use these files:
|
69
|
-
|
70
|
-
* blueprint: blueprints/demo
|
71
|
-
* template: blueprints/demo/app/templates/ec2.rb
|
72
|
-
* param: configs/demo/params/ec2.txt
|
73
|
-
|
74
|
-
## Template Name and Param Name Do Not Match
|
75
|
-
|
76
|
-
The form with most control is the one with all options explicitly specified.
|
77
|
-
|
78
|
-
lono cfn deploy my-demo --blueprint demo --template ec2 --param large
|
79
|
-
|
80
|
-
We'll add another parameter file here: `configs/demo/params/ec2/large.txt`
|
81
|
-
|
82
|
-
└── configs
|
83
|
-
└── demo
|
84
|
-
└── params
|
85
|
-
└── ec2
|
86
|
-
└── large.txt
|
87
|
-
|
88
|
-
Lono will use these files:
|
89
|
-
|
90
|
-
* blueprint: blueprints/demo
|
91
|
-
* template: blueprints/demo/app/templates/ec2.rb
|
92
|
-
* param: configs/demo/params/ec2/large.txt
|
21
|
+
lono cfn deploy my-stack --blueprint demo
|
data/lib/lono/help/cfn/status.md
CHANGED
@@ -13,7 +13,3 @@ Shows the status of the stack. If the stack is in progress then tail the status
|
|
13
13
|
11:52:35PM UPDATE_COMPLETE_CLEANUP_IN_PROGRESS AWS::CloudFormation::Stack ecs-asg
|
14
14
|
11:52:36PM UPDATE_COMPLETE AWS::CloudFormation::Stack ecs-asg
|
15
15
|
|
16
|
-
If current name is set.
|
17
|
-
|
18
|
-
lono cfn current --name ecs-asg
|
19
|
-
lono cfn status
|
data/lib/lono/help/cfn/update.md
CHANGED
@@ -21,7 +21,7 @@ By default, the update command will display a preview of the stack changes befor
|
|
21
21
|
|
22
22
|
## Conventions: template and param
|
23
23
|
|
24
|
-
Lono follows some [coventions](
|
24
|
+
Lono follows some [coventions](https://lono.cloud/docs/conventions/) that helps keep the commands short. We'll go through an example to explain:
|
25
25
|
|
26
26
|
Provided that you are in a lono project and have a `demo` lono blueprint that contains a `demo` template. To update a stack you can run:
|
27
27
|
|
@@ -0,0 +1,51 @@
|
|
1
|
+
## Examples
|
2
|
+
|
3
|
+
lono code convert path/to/file
|
4
|
+
lono code convert http://example.com/url/to/template.yml
|
5
|
+
lono code convert http://example.com/url/to/template.json
|
6
|
+
|
7
|
+
## Example with Output
|
8
|
+
|
9
|
+
$ lono code convert https://s3-us-east-2.amazonaws.com/cloudformation-templates-us-east-2/AutoScalingMultiAZWithNotifications.template
|
10
|
+
INFO: The ruby syntax is valid
|
11
|
+
INFO: Translated ruby code below:
|
12
|
+
|
13
|
+
aws_template_format_version "2010-09-09"
|
14
|
+
parameter("VpcId",
|
15
|
+
type: "AWS::EC2::VPC::Id",
|
16
|
+
description: "VpcId of your existing Virtual Private Cloud (VPC)",
|
17
|
+
constraint_description: "must be the VPC Id of an existing Virtual Private Cloud."
|
18
|
+
)
|
19
|
+
...
|
20
|
+
...
|
21
|
+
...
|
22
|
+
resource("InstanceSecurityGroup", "AWS::EC2::SecurityGroup",
|
23
|
+
group_description: "Enable SSH access and HTTP from the load balancer only",
|
24
|
+
security_group_ingress: [
|
25
|
+
{
|
26
|
+
ip_protocol: "tcp",
|
27
|
+
from_port: "22",
|
28
|
+
to_port: "22",
|
29
|
+
cidr_ip: ref("SSHLocation")
|
30
|
+
},
|
31
|
+
{
|
32
|
+
ip_protocol: "tcp",
|
33
|
+
from_port: "80",
|
34
|
+
to_port: "80",
|
35
|
+
source_security_group_id: select(0,get_att("ApplicationLoadBalancer","SecurityGroups"))
|
36
|
+
}
|
37
|
+
],
|
38
|
+
vpc_id: ref("VpcId")
|
39
|
+
)
|
40
|
+
output("URL",
|
41
|
+
description: "The URL of the website",
|
42
|
+
value: join("",[
|
43
|
+
"http://",
|
44
|
+
get_att("ApplicationLoadBalancer","DNSName")
|
45
|
+
])
|
46
|
+
)
|
47
|
+
|
48
|
+
The `INFO` messages are written to stderr so you can grab the translated template Ruby code by directing it to a file. Example:
|
49
|
+
|
50
|
+
lono code convert https://s3-us-east-2.amazonaws.com/cloudformation-templates-us-east-2/AutoScalingMultiAZWithNotifications.template > autoscaling.rb
|
51
|
+
cat autoscaling.rb
|
@@ -0,0 +1,30 @@
|
|
1
|
+
## Examples
|
2
|
+
|
3
|
+
lono code import path/to/file
|
4
|
+
lono code import http://example.com/url/to/template.yml
|
5
|
+
lono code import http://example.com/url/to/template.json
|
6
|
+
lono code import http://example.com/url/to/template.json --blueprint myblueprint
|
7
|
+
|
8
|
+
## Example with Output
|
9
|
+
|
10
|
+
$ URL=https://s3.amazonaws.com/cloudformation-templates-us-east-1/EC2InstanceWithSecurityGroupSample.template
|
11
|
+
$ lono code import $URL --blueprint ec2
|
12
|
+
=> Creating new blueprint called ec2.
|
13
|
+
create blueprints/ec2
|
14
|
+
create blueprints/ec2/ec2.gemspec
|
15
|
+
create blueprints/ec2/.gitignore
|
16
|
+
create blueprints/ec2/.meta/config.yml
|
17
|
+
create blueprints/ec2/CHANGELOG.md
|
18
|
+
create blueprints/ec2/Gemfile
|
19
|
+
create blueprints/ec2/README.md
|
20
|
+
create blueprints/ec2/Rakefile
|
21
|
+
create blueprints/ec2/seed/configs.rb
|
22
|
+
create blueprints/ec2/app/templates
|
23
|
+
create blueprints/ec2/app/templates/ec2.rb
|
24
|
+
create configs/ec2/params/development.txt
|
25
|
+
create configs/ec2/params/production.txt
|
26
|
+
================================================================
|
27
|
+
Congrats You have successfully imported a lono blueprint.
|
28
|
+
|
29
|
+
More info: https://lono.cloud/docs/core/blueprints
|
30
|
+
$
|
@@ -0,0 +1,24 @@
|
|
1
|
+
## Examples
|
2
|
+
|
3
|
+
When the `lono configsets` command is passed the blueprint will list the configsets for the blueprint.
|
4
|
+
|
5
|
+
$ lono configsets ec2
|
6
|
+
Configsets used by ec2 blueprint:
|
7
|
+
+-------+----------------------+---------+---------+
|
8
|
+
| Name | Path | Type | From |
|
9
|
+
+-------+----------------------+---------+---------+
|
10
|
+
| httpd | app/configsets/httpd | project | project |
|
11
|
+
+-------+----------------------+---------+---------+
|
12
|
+
$
|
13
|
+
|
14
|
+
When there are no arguments passed to the `lono configsets` command it will list the project configsets.
|
15
|
+
|
16
|
+
$ lono configsets
|
17
|
+
Project configsets:
|
18
|
+
+-------+------------------------+---------+
|
19
|
+
| Name | Path | Type |
|
20
|
+
+-------+------------------------+---------+
|
21
|
+
| httpd | app/configsets/httpd | project |
|
22
|
+
| ruby | vendor/configsets/ruby | vendor |
|
23
|
+
+-------+------------------------+---------+
|
24
|
+
$
|
data/lib/lono/help/generate.md
CHANGED
@@ -2,13 +2,13 @@ Generates CloudFormation template, parameter files, and scripts in lono project
|
|
2
2
|
|
3
3
|
## Examples
|
4
4
|
|
5
|
-
lono generate
|
6
|
-
lono generate --clean
|
7
|
-
lono g --clean # shortcut
|
5
|
+
lono generate BLUEPRINT
|
6
|
+
lono generate BLUEPRINT --clean
|
7
|
+
lono g BLUEPRINT --clean # shortcut
|
8
8
|
|
9
9
|
## Example Output
|
10
10
|
|
11
|
-
$ lono generate
|
11
|
+
$ lono generate ec2
|
12
12
|
Generating CloudFormation templates, parameters, and scripts
|
13
13
|
Generating CloudFormation templates:
|
14
14
|
output/templates/ec2.yml
|
data/lib/lono/help/new.md
CHANGED
@@ -18,7 +18,6 @@ By default, `lono new` generates a skeleton project. Use `TEMPLATE` to generate
|
|
18
18
|
create infra/blueprints/demo
|
19
19
|
create infra/blueprints/demo/demo.gemspec
|
20
20
|
create infra/blueprints/demo/.gitignore
|
21
|
-
create infra/blueprints/demo/.meta/config.yml
|
22
21
|
create infra/blueprints/demo/Gemfile
|
23
22
|
create infra/blueprints/demo/README.md
|
24
23
|
create infra/blueprints/demo/seed/configs.rb
|
@@ -54,5 +53,5 @@ By default, `lono new` generates a skeleton project. Use `TEMPLATE` to generate
|
|
54
53
|
|
55
54
|
To list and create additional blueprints refer to https://lono.cloud/docs/core/blueprints
|
56
55
|
|
57
|
-
More info:
|
56
|
+
More info: https://lono.cloud/
|
58
57
|
$
|
@@ -0,0 +1,76 @@
|
|
1
|
+
## Example
|
2
|
+
|
3
|
+
$ lono sets deploy my-set --blueprint demo
|
4
|
+
Generating CloudFormation templates for blueprint demo:
|
5
|
+
output/demo/templates/demo.yml
|
6
|
+
Uploading CloudFormation templates...
|
7
|
+
Uploaded: output/demo/templates/demo.yml to s3://lono-bucket-12di8xz5sy72z/development/output/demo/templates/demo.yml
|
8
|
+
Templates uploaded to s3.
|
9
|
+
Generating parameter files for blueprint demo:
|
10
|
+
Using params for development: configs/demo/params/development.txt
|
11
|
+
output/demo/params/development.json
|
12
|
+
Parameter Diff Preview:
|
13
|
+
Running: colordiff /tmp/lono/params-preview/existing.json /tmp/lono/params-preview/new.json
|
14
|
+
There were no differences.
|
15
|
+
Generating CloudFormation source code diff...
|
16
|
+
Running: colordiff /tmp/existing_stack_set.yml /home/ec2-user/environment/infra/output/demo/templates/demo.yml
|
17
|
+
33c33
|
18
|
+
< Value: '2019-12-19 22:46:33 +0000'
|
19
|
+
---
|
20
|
+
> Value: '2019-12-19 23:08:05 +0000'
|
21
|
+
Parameters passed to cfn.update_stack_set:
|
22
|
+
---
|
23
|
+
stack_set_name: my-set
|
24
|
+
parameters:
|
25
|
+
- parameter_key: GroupDescription
|
26
|
+
parameter_value: my-group-description-1
|
27
|
+
template_url: https://lono-bucket-12di8xz5sy72z.s3.us-west-2.amazonaws.com/development/output/demo/templates/demo.yml
|
28
|
+
template_body: 'Hidden due to size... View at: output/demo/templates/demo.yml'
|
29
|
+
Are you sure you want to update the my-set stack set?
|
30
|
+
Will deploy to:
|
31
|
+
account: 112233445566
|
32
|
+
regions: ap-northeast-1,ap-northeast-2,us-west-1,us-west-2
|
33
|
+
account: 223344556677
|
34
|
+
regions: ap-northeast-1,ap-northeast-2,us-west-1,us-west-2
|
35
|
+
|
36
|
+
Number of stack instances to be updated: 8
|
37
|
+
Are you sure? (y/N) y
|
38
|
+
Updating my-set stack set
|
39
|
+
Stack Set Operation Status: RUNNING
|
40
|
+
Stack Instance statuses... (takes a while)
|
41
|
+
2019-12-19 11:08:21 PM Stack Instance: account 112233445566 region ap-northeast-1 status OUTDATED reason User initiated operation
|
42
|
+
2019-12-19 11:08:21 PM Stack Instance: account 112233445566 region us-west-2 status OUTDATED reason User initiated operation
|
43
|
+
2019-12-19 11:08:23 PM Stack Instance: account 112233445566 region ap-northeast-2 status OUTDATED reason User initiated operation
|
44
|
+
2019-12-19 11:08:30 PM Stack Instance: account 223344556677 region ap-northeast-1 status OUTDATED reason User initiated operation
|
45
|
+
2019-12-19 11:08:30 PM Stack Instance: account 223344556677 region ap-northeast-2 status OUTDATED reason User initiated operation
|
46
|
+
2019-12-19 11:08:30 PM Stack Instance: account 112233445566 region us-west-1 status OUTDATED reason User initiated operation
|
47
|
+
2019-12-19 11:08:30 PM Stack Instance: account 223344556677 region us-west-1 status OUTDATED reason User Initiated
|
48
|
+
2019-12-19 11:08:31 PM Stack Instance: account 223344556677 region us-west-2 status OUTDATED reason User initiated operation
|
49
|
+
2019-12-19 11:08:49 PM Stack Instance: account 223344556677 region us-west-1 status CURRENT
|
50
|
+
2019-12-19 11:08:58 PM Stack Instance: account 112233445566 region us-west-1 status OUTDATED reason User Initiated
|
51
|
+
2019-12-19 11:09:17 PM Stack Instance: account 112233445566 region us-west-1 status CURRENT
|
52
|
+
2019-12-19 11:09:28 PM Stack Instance: account 112233445566 region ap-northeast-2 status OUTDATED reason User Initiated
|
53
|
+
2019-12-19 11:09:51 PM Stack Instance: account 112233445566 region ap-northeast-2 status CURRENT
|
54
|
+
2019-12-19 11:10:03 PM Stack Instance: account 223344556677 region ap-northeast-2 status OUTDATED reason User Initiated
|
55
|
+
2019-12-19 11:10:27 PM Stack Instance: account 223344556677 region ap-northeast-2 status CURRENT
|
56
|
+
2019-12-19 11:10:36 PM Stack Instance: account 112233445566 region ap-northeast-1 status OUTDATED reason User Initiated
|
57
|
+
2019-12-19 11:10:59 PM Stack Instance: account 112233445566 region ap-northeast-1 status CURRENT
|
58
|
+
2019-12-19 11:11:08 PM Stack Instance: account 223344556677 region ap-northeast-1 status OUTDATED
|
59
|
+
2019-12-19 11:11:13 PM Stack Instance: account 223344556677 region ap-northeast-1 status OUTDATED reason User Initiated
|
60
|
+
2019-12-19 11:11:36 PM Stack Instance: account 223344556677 region ap-northeast-1 status CURRENT
|
61
|
+
2019-12-19 11:11:46 PM Stack Instance: account 112233445566 region us-west-2 status OUTDATED reason User Initiated
|
62
|
+
2019-12-19 11:12:09 PM Stack Instance: account 112233445566 region us-west-2 status CURRENT
|
63
|
+
2019-12-19 11:12:19 PM Stack Instance: account 223344556677 region us-west-2 status OUTDATED reason User Initiated
|
64
|
+
Stack Set Operation Status: SUCCEEDED
|
65
|
+
2019-12-19 11:12:42 PM Stack Instance: account 223344556677 region us-west-2 status CURRENT
|
66
|
+
Time took to complete stack set operation: 4m 29s
|
67
|
+
Stack Set Operation Summary:
|
68
|
+
account 223344556677 region us-west-1 status SUCCEEDED
|
69
|
+
account 112233445566 region us-west-2 status SUCCEEDED
|
70
|
+
account 112233445566 region ap-northeast-1 status SUCCEEDED
|
71
|
+
account 112233445566 region ap-northeast-2 status SUCCEEDED
|
72
|
+
account 223344556677 region ap-northeast-2 status SUCCEEDED
|
73
|
+
account 223344556677 region us-west-2 status SUCCEEDED
|
74
|
+
account 112233445566 region us-west-1 status SUCCEEDED
|
75
|
+
account 223344556677 region ap-northeast-1 status SUCCEEDED
|
76
|
+
demo
|