lono 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/bin/commit_docs.sh +26 -0
  3. data/.circleci/config.yml +15 -0
  4. data/CHANGELOG.md +4 -0
  5. data/README.md +2 -2
  6. data/Rakefile +6 -0
  7. data/lib/lono/cfn/diff.rb +1 -1
  8. data/lib/lono/cfn.rb +6 -7
  9. data/lib/lono/cli.rb +10 -10
  10. data/lib/lono/command.rb +14 -0
  11. data/lib/lono/help/cfn/create.md +6 -7
  12. data/lib/lono/help/cfn/delete.md +11 -3
  13. data/lib/lono/help/cfn/diff.md +12 -3
  14. data/lib/lono/help/cfn/download.md +1 -3
  15. data/lib/lono/help/cfn/preview.md +21 -6
  16. data/lib/lono/help/cfn/update.md +5 -5
  17. data/lib/lono/help/cfn.md +1 -1
  18. data/lib/lono/help/completion.md +7 -7
  19. data/lib/lono/help/completion_script.md +2 -2
  20. data/lib/lono/help/generate.md +16 -5
  21. data/lib/lono/help/import.md +25 -5
  22. data/lib/lono/help/new.md +52 -6
  23. data/lib/lono/help/param/generate.md +3 -5
  24. data/lib/lono/help/param.md +1 -1
  25. data/lib/lono/help/script/build.md +1 -3
  26. data/lib/lono/help/script/upload.md +2 -2
  27. data/lib/lono/help/summary.md +19 -0
  28. data/lib/lono/help/template/bashify.md +1 -1
  29. data/lib/lono/help/template/generate.md +1 -1
  30. data/lib/lono/help/template.md +1 -1
  31. data/lib/lono/help/upgrade4.md +25 -0
  32. data/lib/lono/help/user_data.md +36 -1
  33. data/lib/lono/help/xgraph.md +16 -0
  34. data/lib/lono/help.rb +7 -0
  35. data/lib/lono/markdown/creator.rb +65 -0
  36. data/lib/lono/markdown/index.rb +36 -0
  37. data/lib/lono/markdown/page.rb +169 -0
  38. data/lib/lono/markdown/shell.rb +11 -0
  39. data/lib/lono/markdown.rb +8 -0
  40. data/lib/lono/param.rb +1 -1
  41. data/lib/lono/script.rb +2 -2
  42. data/lib/lono/version.rb +1 -1
  43. data/lib/lono.rb +1 -0
  44. data/spec/lib/lono/markdown_spec.rb +99 -0
  45. metadata +13 -6
  46. data/lib/lono/help/hello.md +0 -5
  47. data/lib/lono/help/inspect/depends.md +0 -3
  48. data/lib/lono/help/inspect/summary.md +0 -3
  49. data/lib/lono/help/inspect.md +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 813d3d801fda95c8b91d3664909e105efa0233aa589324dd8480ff70d8364e83
4
- data.tar.gz: 47425854afafa70350676c4e2a8af6b409c10f272d0547e679d45bec168ed0e5
3
+ metadata.gz: a05093ad7da8ea1a203d0583ccaf9823fd835bb6574943367a6faae76c1b1feb
4
+ data.tar.gz: d7e4484799d0024ea6d230fe1aca0da86eb2359b7e4cb5ccb0eaaad088c5c554
5
5
  SHA512:
6
- metadata.gz: c8c3bcc99b77b005f58d93d6893e44e74badf2bb86dc44dda78d0d364f003c4473a847ad7875ccbd9fac77177e884214dfdd0c546e80b0d5e9013a4652bacf2a
7
- data.tar.gz: '049cebb1112d4ddacbe892965b615fffd93b0fc96ced048aae471d4798d42852f544f3a2ba51989ea711a88661cb3ccb76104afac4c5e204cf21efe52f7736b4'
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" style="max-width: 300px" />
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 provisions of the infrastructure.
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
@@ -4,3 +4,9 @@ require "rspec/core/rake_task"
4
4
  task :default => :spec
5
5
 
6
6
  RSpec::Core::RakeTask.new
7
+
8
+ require_relative "lib/lono"
9
+ desc "Generates cli reference docs as markdown"
10
+ task :docs do
11
+ Lono::Markdown::Creator.create_all(Lono::CLI)
12
+ end
data/lib/lono/cfn/diff.rb CHANGED
@@ -38,7 +38,7 @@ class Lono::Cfn::Diff < Lono::Cfn::Base
38
38
  end
39
39
 
40
40
  def diff_viewer
41
- return ENV['LONO_CFN_DIFF'] if ENV['LONO_CFN_DIFF']
41
+ return ENV['LONO_DIFF'] if ENV['LONO_DIFF']
42
42
  system("type colordiff > /dev/null") ? "colordiff" : "diff"
43
43
  end
44
44
 
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", "create a CloudFormation 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", "update a CloudFormation 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", "delete a CloudFormation 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", "preview a CloudFormation stack update"
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", "diff of newly generated template vs existing template in AWS"
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", "download CloudFormation template from existing 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 raw CloudFormation template and lono-fies it"
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("graph")
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", hide: true
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", "upgrade from version 3 to 4"
69
- long_desc Help.text("upgrade3")
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 subcommand tasks"
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 subcommand tasks"
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 subcommand tasks"
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 subcommand tasks"
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
@@ -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 simply run:
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. The template by convention defaults to the name of the stack. In turn, the params by convention defaults to the name of the template.
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/prod/different1.json.
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/prod/different2.json.
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/prod/different4.json.
22
-
21
+ The template used is `output/templates/different3.json` and the parameters used is `output/params/different4.json`.
@@ -1,5 +1,13 @@
1
- Examples:
1
+ ## Examples
2
2
 
3
- lono cfn delete my-stack
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
- The above command will delete my-stack.
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
+ $
@@ -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 LONO_CFN_DIFF environment variable.
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
- lono cfn diff my-stack
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,5 +1,3 @@
1
- Download CloudFormation template from existing template on AWS.
2
-
3
- Examples:
1
+ ## Examples
4
2
 
5
3
  lono cfn download my-stack
@@ -1,11 +1,26 @@
1
- Generates a CloudFormation preview. This is similar to a `terraform plan` or puppet's dry-run mode.
1
+ ## Examples
2
2
 
3
- Example output:
3
+ We'll make a change to the default InstanceType of a CloudFromation stack.
4
4
 
5
- CloudFormation preview for 'example' stack update. Changes:
5
+ lono cfn preview my-stack
6
6
 
7
- Remove AWS::Route53::RecordSet: DnsRecord testsubdomain.sub.tongueroo.com
7
+ The output should look similiar to this:
8
8
 
9
- Examples:
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
- lono cfn preview my-stack
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.
@@ -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. The template by convention defaults to the name of the stack. In turn, the params by convention defaults to the name of the template.
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/prod/different1.json.
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/prod/different2.json.
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/prod/different4.json.
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
@@ -1,4 +1,4 @@
1
- Examples:
1
+ ## Examples
2
2
 
3
3
  lono cfn create my-stack
4
4
  lono cfn preview my-stack
@@ -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 hello
11
- lono completion hello name
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 hello [TAB]
21
- lono hello name [TAB]
22
- lono hello name --[TAB]
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 ~/.bashrc or ~/.profile
1
+ To use, add the following to your `~/.bashrc` or `~/.profile`:
2
2
 
3
- eval $(lono completion script)
3
+ eval $(lono completion script)
@@ -1,7 +1,18 @@
1
- Examples:
1
+ Generates CloudFormation template, parameter files, and scripts in lono project. Writes writes them to the `output` folder.
2
2
 
3
- lono generate
4
- lono generate --clean
5
- lono g --clean # shortcut
3
+ ## Examples
6
4
 
7
- Builds both CloudFormation template and parameter files based on lono project and writes them to the output folder on the filesystem.
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
+ $
@@ -1,7 +1,27 @@
1
- Examples:
1
+ ## Examples
2
2
 
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
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
- Imports a raw CloudFormation template and lono-fies it.
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
- lono new infra # skeleton project with barebones structure
4
- TEMPLATE=ec2 lono new infra # creates a single server
5
- TEMPLATE=autoscaling lono new infra
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
- For a list of the starter templates:
8
- https://github.com/tongueroo/lono/tree/master/lib/starter_projects
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
- lono-params generate
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
@@ -1,3 +1,3 @@
1
- Examples:
1
+ ## Examples
2
2
 
3
3
  lono param generate
@@ -1,5 +1,3 @@
1
- Builds output/scripts/scripts-md5sum.tgz from app/script folder.
2
-
3
- Examples:
1
+ ## Examples
4
2
 
5
3
  lono script build
@@ -1,8 +1,8 @@
1
- Uploads output/scripts/scripts-md5sum.tgz to s3_folder configured in settings.yml. This command must be ran after `lono script build` since it relies the artifacts of that command. Namely:
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)
@@ -1,4 +1,4 @@
1
- Examples:
1
+ ## Examples
2
2
 
3
3
  lono template bashify /path/to/cloudformation-template.json
4
4
  lono template bashify https://s3.amazonaws.com/cloudformation-templates-us-east-1/EC2WebSiteSample.template
@@ -1,4 +1,4 @@
1
- Examples:
1
+ ## Examples
2
2
 
3
3
  lono template generate
4
4
  lono template generate --clean
@@ -1,4 +1,4 @@
1
- Examples:
1
+ ## Examples
2
2
 
3
3
  lono template generate --help
4
4
  lono template bashify --help