lono 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/bin/commit_docs.sh +26 -0
- data/.circleci/config.yml +15 -0
- data/CHANGELOG.md +4 -0
- data/README.md +2 -2
- data/Rakefile +6 -0
- data/lib/lono/cfn/diff.rb +1 -1
- data/lib/lono/cfn.rb +6 -7
- data/lib/lono/cli.rb +10 -10
- data/lib/lono/command.rb +14 -0
- data/lib/lono/help/cfn/create.md +6 -7
- data/lib/lono/help/cfn/delete.md +11 -3
- data/lib/lono/help/cfn/diff.md +12 -3
- data/lib/lono/help/cfn/download.md +1 -3
- data/lib/lono/help/cfn/preview.md +21 -6
- data/lib/lono/help/cfn/update.md +5 -5
- data/lib/lono/help/cfn.md +1 -1
- data/lib/lono/help/completion.md +7 -7
- data/lib/lono/help/completion_script.md +2 -2
- data/lib/lono/help/generate.md +16 -5
- data/lib/lono/help/import.md +25 -5
- data/lib/lono/help/new.md +52 -6
- data/lib/lono/help/param/generate.md +3 -5
- data/lib/lono/help/param.md +1 -1
- data/lib/lono/help/script/build.md +1 -3
- data/lib/lono/help/script/upload.md +2 -2
- data/lib/lono/help/summary.md +19 -0
- data/lib/lono/help/template/bashify.md +1 -1
- data/lib/lono/help/template/generate.md +1 -1
- data/lib/lono/help/template.md +1 -1
- data/lib/lono/help/upgrade4.md +25 -0
- data/lib/lono/help/user_data.md +36 -1
- data/lib/lono/help/xgraph.md +16 -0
- data/lib/lono/help.rb +7 -0
- data/lib/lono/markdown/creator.rb +65 -0
- data/lib/lono/markdown/index.rb +36 -0
- data/lib/lono/markdown/page.rb +169 -0
- data/lib/lono/markdown/shell.rb +11 -0
- data/lib/lono/markdown.rb +8 -0
- data/lib/lono/param.rb +1 -1
- data/lib/lono/script.rb +2 -2
- data/lib/lono/version.rb +1 -1
- data/lib/lono.rb +1 -0
- data/spec/lib/lono/markdown_spec.rb +99 -0
- metadata +13 -6
- data/lib/lono/help/hello.md +0 -5
- data/lib/lono/help/inspect/depends.md +0 -3
- data/lib/lono/help/inspect/summary.md +0 -3
- data/lib/lono/help/inspect.md +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a05093ad7da8ea1a203d0583ccaf9823fd835bb6574943367a6faae76c1b1feb
|
4
|
+
data.tar.gz: d7e4484799d0024ea6d230fe1aca0da86eb2359b7e4cb5ccb0eaaad088c5c554
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 660d43b879898e550cf3ed5039220e00c5c9af11189e03d1dd8284c93223dd888b2127a0548abbecf81b22a0479fe3bcc8461f9dc0dd82488df6558e1fd5364f
|
7
|
+
data.tar.gz: ba6a544e8fe3d24b1528df365c63a8e0e2c4fc55aa6d5729e1ad7e0cc4bc55a27aee465c7c6f42abcc470399f830268a6455c9cd77607ddbf002befe190cd91a
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/bin/bash -eux
|
2
|
+
|
3
|
+
# Even though specs also generate docs, lets run again to ensure clean slate
|
4
|
+
rake docs
|
5
|
+
|
6
|
+
out=$(git status docs)
|
7
|
+
if [[ "$out" = *"nothing to commit"* ]]; then
|
8
|
+
exit
|
9
|
+
fi
|
10
|
+
|
11
|
+
COMMIT_MESSAGE="docs updated by circleci"
|
12
|
+
|
13
|
+
# If the last commit already updated the docs, then exit.
|
14
|
+
# Preventable measure to avoid infinite loop.
|
15
|
+
if git log -1 --pretty=oneline | grep "$COMMIT_MESSAGE" ; then
|
16
|
+
exit
|
17
|
+
fi
|
18
|
+
|
19
|
+
# If reach here, we have some changes on docs that we should commit.
|
20
|
+
# Even though s
|
21
|
+
git add docs
|
22
|
+
git commit -m "$COMMIT_MESSAGE"
|
23
|
+
|
24
|
+
# https://makandracards.com/makandra/12107-git-show-current-branch-name-only
|
25
|
+
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
26
|
+
git push origin "$current_branch"
|
data/.circleci/config.yml
CHANGED
@@ -42,6 +42,13 @@ jobs:
|
|
42
42
|
- ./vendor/bundle
|
43
43
|
key: v1-dependencies-{{ checksum "Gemfile" }}
|
44
44
|
|
45
|
+
# specs need git configured ad commit_docs.sh required it also
|
46
|
+
- run:
|
47
|
+
name: configure git
|
48
|
+
command: |
|
49
|
+
git config --global user.email "tongueroo@gmail.com"
|
50
|
+
git config --global user.name "Tung Nguyen"
|
51
|
+
|
45
52
|
# run tests!
|
46
53
|
- run:
|
47
54
|
name: run tests
|
@@ -49,6 +56,14 @@ jobs:
|
|
49
56
|
mkdir /tmp/test-results
|
50
57
|
bundle exec rspec
|
51
58
|
|
59
|
+
# The specs will generate reference docs.
|
60
|
+
# Commit it again so that the reference docs are published to GitHub pages.
|
61
|
+
- run:
|
62
|
+
name: commit cli reference docs
|
63
|
+
command: |
|
64
|
+
chmod a+x -R .circleci/bin
|
65
|
+
.circleci/bin/commit_docs.sh
|
66
|
+
|
52
67
|
# collect reports
|
53
68
|
- store_test_results:
|
54
69
|
path: /tmp/test-results
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [4.0.1]
|
7
|
+
- add http://lono.cloud/reference/
|
8
|
+
- improve cli docs
|
9
|
+
|
6
10
|
## [4.0.0]
|
7
11
|
- lono upgrade4 command
|
8
12
|
- simplified lono project structure
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<div align="center">
|
2
|
-
<img src="http://lono.cloud/img/logos/lono-logo.png"
|
2
|
+
<img src="http://lono.cloud/img/logos/lono-logo-small.png" />
|
3
3
|
</div>
|
4
4
|
|
5
5
|
# Lono
|
@@ -15,7 +15,7 @@
|
|
15
15
|
[3]: https://codeclimate.com/repos/51d7f1407e00a4042c010ab4/badges/5273fe6cdb5a13e58554/gpa.png
|
16
16
|
[4]: https://codeclimate.com/repos/51d7f1407e00a4042c010ab4/feed
|
17
17
|
|
18
|
-
Lono is a tool to help you manage your CloudFormation templates. Lono handles the entire CloudFormation lifecyle. It helps you craft the templates and then
|
18
|
+
Lono is a tool to help you manage your CloudFormation templates. Lono handles the entire CloudFormation lifecyle. It helps you craft the templates and then provision the infrastructure.
|
19
19
|
|
20
20
|
* Lono generates CloudFormation templates based on ERB ruby templates in `yaml` format.
|
21
21
|
* Lono takes simple env-like files and generates the CloudFormation parameter files.
|
data/Rakefile
CHANGED
data/lib/lono/cfn/diff.rb
CHANGED
data/lib/lono/cfn.rb
CHANGED
@@ -14,7 +14,6 @@ class Lono::Cfn < Lono::Command
|
|
14
14
|
|
15
15
|
class_option :verbose, type: :boolean
|
16
16
|
class_option :noop, type: :boolean
|
17
|
-
class_option :region, desc: "AWS region"
|
18
17
|
|
19
18
|
# common to create and update
|
20
19
|
class_option :template, desc: "override convention and specify the template file to use"
|
@@ -24,14 +23,14 @@ class Lono::Cfn < Lono::Command
|
|
24
23
|
class_option :iam, type: :boolean, desc: "Shortcut for common IAM capabilities: CAPABILITY_IAM, CAPABILITY_NAMED_IAM"
|
25
24
|
class_option :rollback, type: :boolean, desc: "rollback", default: true
|
26
25
|
|
27
|
-
desc "create STACK", "
|
26
|
+
desc "create STACK", "Create a CloudFormation stack using the generated template."
|
28
27
|
option :randomize_stack_name, type: :boolean, desc: "tack on random string at the end of the stack name", default: nil
|
29
28
|
long_desc Lono::Help.text("cfn/create")
|
30
29
|
def create(name)
|
31
30
|
Create.new(name, options).run
|
32
31
|
end
|
33
32
|
|
34
|
-
desc "update STACK", "
|
33
|
+
desc "update STACK", "Update a CloudFormation stack using the generated template."
|
35
34
|
long_desc Lono::Help.text("cfn/update")
|
36
35
|
option :change_set, type: :boolean, default: true, desc: "Uses generated change set to update the stack. If false, will perform normal update-stack."
|
37
36
|
option :diff, type: :boolean, default: true, desc: "Show diff of the source code template changes before continuing."
|
@@ -41,14 +40,14 @@ class Lono::Cfn < Lono::Command
|
|
41
40
|
Update.new(name, options).run
|
42
41
|
end
|
43
42
|
|
44
|
-
desc "delete STACK", "
|
43
|
+
desc "delete STACK", "Delete a CloudFormation stack."
|
45
44
|
long_desc Lono::Help.text("cfn/delete")
|
46
45
|
option :sure, type: :boolean, desc: "Skips are you sure prompt"
|
47
46
|
def delete(name)
|
48
47
|
Delete.new(name, options).run
|
49
48
|
end
|
50
49
|
|
51
|
-
desc "preview STACK", "
|
50
|
+
desc "preview STACK", "Preview a CloudFormation stack update. This is similar to terraform's plan or puppet's dry-run mode."
|
52
51
|
long_desc Lono::Help.text("cfn/preview")
|
53
52
|
option :keep, type: :boolean, desc: "keep the changeset instead of deleting it afterwards"
|
54
53
|
option :diff, type: :boolean, default: true, desc: "Show diff of the source code template changes also."
|
@@ -57,13 +56,13 @@ class Lono::Cfn < Lono::Command
|
|
57
56
|
Preview.new(name, options).run
|
58
57
|
end
|
59
58
|
|
60
|
-
desc "diff STACK", "
|
59
|
+
desc "diff STACK", "Diff newly generated template vs existing template."
|
61
60
|
long_desc Lono::Help.text("cfn/diff")
|
62
61
|
def diff(name)
|
63
62
|
Diff.new(name, options).run
|
64
63
|
end
|
65
64
|
|
66
|
-
desc "download STACK", "
|
65
|
+
desc "download STACK", "Download CloudFormation template from existing stack."
|
67
66
|
long_desc Lono::Help.text("cfn/download")
|
68
67
|
option :name, desc: "Name you want to save the template as. Default: existing stack name."
|
69
68
|
def download(stack_name)
|
data/lib/lono/cli.rb
CHANGED
@@ -7,7 +7,7 @@ module Lono
|
|
7
7
|
end
|
8
8
|
register(New, "new", "new NAME", "generates new CLI project")
|
9
9
|
|
10
|
-
desc "import SOURCE", "Imports
|
10
|
+
desc "import SOURCE", "Imports CloudFormation template and lono-fies it."
|
11
11
|
long_desc Help.text(:import)
|
12
12
|
option :name, required: true, default: nil, desc: "final name of downloaded template without extension"
|
13
13
|
option :summary, default: true, type: :boolean, desc: "provide template summary after import"
|
@@ -41,14 +41,14 @@ module Lono
|
|
41
41
|
end
|
42
42
|
|
43
43
|
desc "xgraph STACK", "Graphs dependencies tree of CloudFormation template resources"
|
44
|
-
long_desc Help.text("
|
44
|
+
long_desc Help.text("xgraph")
|
45
45
|
option :display, type: :string, desc: "graph or text", default: "graph"
|
46
46
|
option :noop, type: :boolean, desc: "noop mode"
|
47
47
|
def xgraph(name)
|
48
48
|
Lono::Inspector::Graph.new(name, options).run
|
49
49
|
end
|
50
50
|
|
51
|
-
desc "clean", "Clean up generated files"
|
51
|
+
desc "clean", "Clean up generated files in `output` folder."
|
52
52
|
def clean
|
53
53
|
Clean.new(options).run
|
54
54
|
end
|
@@ -59,14 +59,14 @@ module Lono
|
|
59
59
|
Completer.new(CLI, *params).run
|
60
60
|
end
|
61
61
|
|
62
|
-
desc "completion_script", "generates script that can be eval to setup auto-completion"
|
62
|
+
desc "completion_script", "generates script that can be eval to setup auto-completion"
|
63
63
|
long_desc Help.text("completion_script")
|
64
64
|
def completion_script
|
65
65
|
Completer::Script.generate
|
66
66
|
end
|
67
67
|
|
68
|
-
desc "upgrade4", "
|
69
|
-
long_desc Help.text("
|
68
|
+
desc "upgrade4", "Upgrade from version 3 to 4."
|
69
|
+
long_desc Help.text("upgrade4")
|
70
70
|
def upgrade4
|
71
71
|
Upgrade4.new(options).run
|
72
72
|
end
|
@@ -76,19 +76,19 @@ module Lono
|
|
76
76
|
puts VERSION
|
77
77
|
end
|
78
78
|
|
79
|
-
desc "template SUBCOMMAND", "template
|
79
|
+
desc "template SUBCOMMAND", "template subcommands"
|
80
80
|
long_desc Help.text(:template)
|
81
81
|
subcommand "template", Template
|
82
82
|
|
83
|
-
desc "cfn SUBCOMMAND", "cfn
|
83
|
+
desc "cfn SUBCOMMAND", "cfn subcommands"
|
84
84
|
long_desc Help.text(:cfn)
|
85
85
|
subcommand "cfn", Cfn
|
86
86
|
|
87
|
-
desc "param SUBCOMMAND", "param
|
87
|
+
desc "param SUBCOMMAND", "param subcommands"
|
88
88
|
long_desc Help.text(:param)
|
89
89
|
subcommand "param", Param
|
90
90
|
|
91
|
-
desc "script SUBCOMMAND", "script
|
91
|
+
desc "script SUBCOMMAND", "script subcommands"
|
92
92
|
long_desc Help.text(:script)
|
93
93
|
subcommand "script", Script
|
94
94
|
end
|
data/lib/lono/command.rb
CHANGED
@@ -42,6 +42,20 @@ module Lono
|
|
42
42
|
|
43
43
|
super
|
44
44
|
end
|
45
|
+
|
46
|
+
# Override command_help to include the description at the top of the
|
47
|
+
# long_description.
|
48
|
+
def command_help(shell, command_name)
|
49
|
+
meth = normalize_command_name(command_name)
|
50
|
+
command = all_commands[meth]
|
51
|
+
long_desc = if command.long_description
|
52
|
+
"#{command.description}\n\n#{command.long_description}"
|
53
|
+
else
|
54
|
+
command.description
|
55
|
+
end
|
56
|
+
command.long_description = long_desc
|
57
|
+
super
|
58
|
+
end
|
45
59
|
end
|
46
60
|
end
|
47
61
|
end
|
data/lib/lono/help/cfn/create.md
CHANGED
@@ -1,22 +1,21 @@
|
|
1
|
-
Examples
|
1
|
+
## Examples
|
2
2
|
|
3
|
-
Provided that you are in a lono project and have a `my-stack` lono template definition. To create a stack you can
|
3
|
+
Provided that you are in a lono project and have a `my-stack` lono template definition. To create a stack you can run:
|
4
4
|
|
5
5
|
lono cfn create my-stack
|
6
6
|
|
7
|
-
The above command will generate and use the template in output/my-stack.json and parameters in params/my-stack.txt
|
7
|
+
The above command will generate and use the template in `output/templates/my-stack.json` and parameters in `output/params/my-stack.txt`. By [convention]({% link _docs/conventions.md %}), the template defaults to the name of the stack. In turn, the params defaults to the name of the template.
|
8
8
|
|
9
9
|
Here are examples of overriding the template and params name conventions.
|
10
10
|
|
11
11
|
lono cfn create my-stack --template different1
|
12
12
|
|
13
|
-
The template used is output/different1.json and the parameters used is output/params/
|
13
|
+
The template used is `output/templates/different1.json` and the parameters used is `output/params/different1.json`.
|
14
14
|
|
15
15
|
lono cfn create my-stack --params different2
|
16
16
|
|
17
|
-
The template used is output/my-stack.json and the parameters used is output/params/
|
17
|
+
The template used is `output/templates/my-stack.json` and the parameters used is `output/params/different2.json`.
|
18
18
|
|
19
19
|
lono cfn create my-stack --template different3 --params different4
|
20
20
|
|
21
|
-
The template used is output/different3.json and the parameters used is output/params/
|
22
|
-
|
21
|
+
The template used is `output/templates/different3.json` and the parameters used is `output/params/different4.json`.
|
data/lib/lono/help/cfn/delete.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
|
-
Examples
|
1
|
+
## Examples
|
2
2
|
|
3
|
-
|
3
|
+
$ lono cfn delete ec2
|
4
|
+
Are you sure you want to want to delete the stack? (y/N)
|
5
|
+
y
|
6
|
+
Deleted example stack.
|
7
|
+
$
|
4
8
|
|
5
|
-
|
9
|
+
Lono prompts you with an "Are you sure?" message before the stack gets deleted. If you would like to bypass the prompt, you can use the `--sure` flag.
|
10
|
+
|
11
|
+
$ lono cfn delete example --sure
|
12
|
+
Deleted example stack.
|
13
|
+
$
|
data/lib/lono/help/cfn/diff.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
|
-
Displays code diff of the generated CloudFormation template locally vs the existing template on AWS. You can set a desired diff viewer by setting the
|
1
|
+
Displays code diff of the generated CloudFormation template locally vs the existing template on AWS. You can set a desired diff viewer by setting the `LONO_DIFF` environment variable.
|
2
2
|
|
3
|
-
Examples
|
3
|
+
## Examples
|
4
4
|
|
5
|
-
|
5
|
+
lono cfn diff my-stack
|
6
|
+
|
7
|
+
The output should look similiar to this:
|
8
|
+
|
9
|
+
<img src="/img/tutorials/ec2/cfn-update-instance-type.png" alt="Stack Update" class="doc-photo">
|
10
|
+
|
11
|
+
Notice that before the update gets performed lono provides a preview of the changes that are about to take place. There are two types of "diffs" in the preview.
|
12
|
+
|
13
|
+
1. Source code diff of the templates. This is generated by downloading the current CloudFormation template and comparing it with the locally generated one using `colordiff`.
|
14
|
+
2. CloudFormation Change Set list of changes. This is generated using [AWS CloudFormation Change Set](https://medium.com/boltops/a-simple-introduction-to-cloudformation-part-4-change-sets-dry-run-mode-c14e41dfeab7) feature.
|
@@ -1,11 +1,26 @@
|
|
1
|
-
|
1
|
+
## Examples
|
2
2
|
|
3
|
-
|
3
|
+
We'll make a change to the default InstanceType of a CloudFromation stack.
|
4
4
|
|
5
|
-
|
5
|
+
lono cfn preview my-stack
|
6
6
|
|
7
|
-
|
7
|
+
The output should look similiar to this:
|
8
8
|
|
9
|
-
|
9
|
+
Generating CloudFormation source code diff...
|
10
|
+
Running: colordiff /tmp/existing_cfn_template.yml output/templates/ec2.yml
|
11
|
+
14c14
|
12
|
+
< Default: t2.small
|
13
|
+
---
|
14
|
+
> Default: t2.micro
|
15
|
+
Generating CloudFormation Change Set for preview.....
|
16
|
+
CloudFormation preview for 'ec2' stack update. Changes:
|
17
|
+
Modify AWS::EC2::Instance: EC2Instance i-07e939db65120fb75
|
10
18
|
|
11
|
-
|
19
|
+
The preview includes colors:
|
20
|
+
|
21
|
+
<img src="/img/reference/lono-cfn-preview.png" alt="Stack Update" class="doc-photo">
|
22
|
+
|
23
|
+
Notice that before the update gets performed lono provides a preview of the changes that are about to take place. There are two types of "diffs" in the preview.
|
24
|
+
|
25
|
+
1. Source code diff of the templates. This is generated by downloading the current CloudFormation template and comparing it with the locally generated one using `colordiff`.
|
26
|
+
2. CloudFormation Change Set list of changes. This is generated using [AWS CloudFormation Change Set](https://medium.com/boltops/a-simple-introduction-to-cloudformation-part-4-change-sets-dry-run-mode-c14e41dfeab7) feature.
|
data/lib/lono/help/cfn/update.md
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
Examples
|
1
|
+
## Examples
|
2
2
|
|
3
3
|
Provided that you are in a lono project and have a `my-stack` lono template definition. To update a stack you can simply run:
|
4
4
|
|
5
5
|
lono cfn update my-stack
|
6
6
|
|
7
|
-
The above command will generate and use the template in output/my-stack.json and parameters in params/my-stack.txt
|
7
|
+
The above command will generate and use the template in `output/templates/my-stack.json` and parameters in `output/params/my-stack.txt`. The template by convention defaults to the name of the stack. In turn, the params by convention defaults to the name of the template.
|
8
8
|
|
9
9
|
Here are examples of overriding the template and params name conventions.
|
10
10
|
|
11
11
|
lono cfn update my-stack --template different1
|
12
12
|
|
13
|
-
The template used is output/different1.json and the parameters used is output/params/
|
13
|
+
The template used is `output/templates/different1.json` and the parameters used is `output/params/different1.json`.
|
14
14
|
|
15
15
|
lono cfn update my-stack --params different2
|
16
16
|
|
17
|
-
The template used is output/my-stack.json and the parameters used is output/params/
|
17
|
+
The template used is `output/templates/my-stack.json` and the parameters used is `output/params/different2.json`.
|
18
18
|
|
19
19
|
lono cfn update my-stack --template different3 --params different4
|
20
20
|
|
21
|
-
The template used is output/different3.json and the parameters used is output/params/
|
21
|
+
The template used is `output/templates/different3.json` and the parameters used is `output/params/different4.json`.
|
data/lib/lono/help/cfn.md
CHANGED
data/lib/lono/help/completion.md
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
Example
|
1
|
+
## Example
|
2
2
|
|
3
3
|
lono completion
|
4
4
|
|
5
5
|
Prints words for TAB auto-completion.
|
6
6
|
|
7
|
-
Examples
|
7
|
+
## Examples
|
8
8
|
|
9
9
|
lono completion
|
10
|
-
lono completion
|
11
|
-
lono completion
|
10
|
+
lono completion cfn
|
11
|
+
lono completion cfn create
|
12
12
|
|
13
13
|
To enable, TAB auto-completion add the following to your profile:
|
14
14
|
|
@@ -17,6 +17,6 @@ To enable, TAB auto-completion add the following to your profile:
|
|
17
17
|
Auto-completion example usage:
|
18
18
|
|
19
19
|
lono [TAB]
|
20
|
-
lono
|
21
|
-
lono
|
22
|
-
lono
|
20
|
+
lono cfn [TAB]
|
21
|
+
lono cfn create [TAB]
|
22
|
+
lono cfn create --[TAB]
|
@@ -1,3 +1,3 @@
|
|
1
|
-
To use, add the following to your
|
1
|
+
To use, add the following to your `~/.bashrc` or `~/.profile`:
|
2
2
|
|
3
|
-
|
3
|
+
eval $(lono completion script)
|
data/lib/lono/help/generate.md
CHANGED
@@ -1,7 +1,18 @@
|
|
1
|
-
|
1
|
+
Generates CloudFormation template, parameter files, and scripts in lono project. Writes writes them to the `output` folder.
|
2
2
|
|
3
|
-
|
4
|
-
lono generate --clean
|
5
|
-
lono g --clean # shortcut
|
3
|
+
## Examples
|
6
4
|
|
7
|
-
|
5
|
+
lono generate
|
6
|
+
lono generate --clean
|
7
|
+
lono g --clean # shortcut
|
8
|
+
|
9
|
+
## Example Output
|
10
|
+
|
11
|
+
$ lono generate
|
12
|
+
Generating CloudFormation templates, parameters, and scripts
|
13
|
+
No detected app/scripts
|
14
|
+
Generating CloudFormation templates:
|
15
|
+
output/templates/ec2.yml
|
16
|
+
Generating parameter files:
|
17
|
+
output/params/ec2.json
|
18
|
+
$
|
data/lib/lono/help/import.md
CHANGED
@@ -1,7 +1,27 @@
|
|
1
|
-
Examples
|
1
|
+
## Examples
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
lono import /path/to/file
|
4
|
+
lono import http://url.com/path/to/template.json
|
5
|
+
lono import http://url.com/path/to/template.yml
|
6
6
|
|
7
|
-
|
7
|
+
## Example Output
|
8
|
+
|
9
|
+
$ lono import https://s3-us-west-2.amazonaws.com/cloudformation-templates-us-west-2/EC2InstanceWithSecurityGroupSample.template --name ec2
|
10
|
+
=> Imported CloudFormation template and lono-fied it.
|
11
|
+
Template definition added to app/definitions/base.rb
|
12
|
+
Params file created to config/params/base/ec2.txt
|
13
|
+
Template downloaded to app/templates/ec2.yml
|
14
|
+
=> CloudFormation Template Summary:
|
15
|
+
Parameters:
|
16
|
+
Required:
|
17
|
+
KeyName (AWS::EC2::KeyPair::KeyName)
|
18
|
+
Optional:
|
19
|
+
InstanceType (String) Default: t2.small
|
20
|
+
SSHLocation (String) Default: 0.0.0.0/0
|
21
|
+
Resources:
|
22
|
+
1 AWS::EC2::Instance
|
23
|
+
1 AWS::EC2::SecurityGroup
|
24
|
+
2 Total
|
25
|
+
Here are contents of the params config/params/base/ec2.txt file:
|
26
|
+
KeyName=
|
27
|
+
#InstanceType= # optional
|
data/lib/lono/help/new.md
CHANGED
@@ -1,8 +1,54 @@
|
|
1
|
-
Examples
|
1
|
+
## Examples
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
lono new infra # skeleton project with barebones structure
|
4
|
+
TEMPLATE=ec2 lono new infra # creates a single server
|
5
|
+
TEMPLATE=autoscaling lono new infra
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
List of the [starter templates[(https://github.com/tongueroo/lono/tree/master/lib/starter_projects).
|
8
|
+
|
9
|
+
## Example Output
|
10
|
+
|
11
|
+
$ lono new ec2
|
12
|
+
=> Creating new project called ec2.
|
13
|
+
create ec2
|
14
|
+
create ec2/.gitignore
|
15
|
+
create ec2/Gemfile
|
16
|
+
create ec2/Guardfile
|
17
|
+
create ec2/README.md
|
18
|
+
create ec2/app/definitions/base.rb
|
19
|
+
create ec2/config/settings.yml
|
20
|
+
create ec2/welcome.txt
|
21
|
+
create ec2/app/helpers
|
22
|
+
create ec2/app/partials
|
23
|
+
create ec2/app/scripts
|
24
|
+
create ec2/app/templates
|
25
|
+
create ec2/app/user_data
|
26
|
+
create ec2/config/params
|
27
|
+
create ec2/config/variables
|
28
|
+
create ec2/output
|
29
|
+
=> Installing dependencies with: bundle install
|
30
|
+
=> Initialize git repo
|
31
|
+
================================================================
|
32
|
+
Congrats 🎉 You have successfully created a lono project.
|
33
|
+
|
34
|
+
Cd into your project and check things out:
|
35
|
+
|
36
|
+
cd ec2
|
37
|
+
|
38
|
+
Add and edit templates for your project. When you are ready to launch a CloudFormation stack run:
|
39
|
+
|
40
|
+
lono cfn create STACK_NAME
|
41
|
+
|
42
|
+
You can also get started quickly by importing other CloudFormation templates into lono. For example:
|
43
|
+
|
44
|
+
lono import https://s3-us-west-2.amazonaws.com/cloudformation-templates-us-west-2/EC2InstanceWithSecurityGroupSample.template --name ec2
|
45
|
+
|
46
|
+
To re-generate your templates without launching a stack, you can run:
|
47
|
+
|
48
|
+
lono generate
|
49
|
+
|
50
|
+
The generated CloudFormation templates are in the output/templates folder.
|
51
|
+
The generated stack parameters are in the output/params folder. Here's the command with some output filtered to focus on learning.
|
52
|
+
|
53
|
+
More info: http://lono.cloud/
|
54
|
+
$
|
@@ -1,7 +1,5 @@
|
|
1
|
-
Example
|
1
|
+
## Example
|
2
2
|
|
3
|
-
To generate a CloudFormation json parameter files in the params folder to the output/params folder.
|
3
|
+
To generate a CloudFormation json parameter files in the params folder to the `output/params` folder.
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
If you have params/my-stack.txt. It will generate a CloudFormation json file in output/params/my-stack.json.
|
5
|
+
lono param generate
|
data/lib/lono/help/param.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
This command must be ran after `lono script build` since it relies the artifacts of that command. Namely:
|
2
2
|
|
3
3
|
* output/scripts/scripts-md5sum.tgz
|
4
4
|
* output/data/scripts_name.txt
|
5
5
|
|
6
|
-
Examples
|
6
|
+
## Examples
|
7
7
|
|
8
8
|
lono script upload
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Lono inspect is provides commands to help you quickly understand a CloudFormation template.
|
2
|
+
|
3
|
+
## Examples
|
4
|
+
|
5
|
+
$ lono summary ec2
|
6
|
+
=> CloudFormation Template Summary:
|
7
|
+
Parameters:
|
8
|
+
Required:
|
9
|
+
KeyName (AWS::EC2::KeyPair::KeyName)
|
10
|
+
Optional:
|
11
|
+
InstanceType (String) Default: t2.micro
|
12
|
+
SSHLocation (String) Default: 0.0.0.0/0
|
13
|
+
Resources:
|
14
|
+
1 AWS::EC2::Instance
|
15
|
+
1 AWS::EC2::SecurityGroup
|
16
|
+
2 Total
|
17
|
+
$
|
18
|
+
|
19
|
+
Blog Post also covers this: [lono inspect summary Tutorial Introduction](https://blog.boltops.com/2017/09/18/lono-inspect-summary-tutorial-introduction)
|
data/lib/lono/help/template.md
CHANGED