lono 4.2.7 → 5.0.1
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 +6 -0
- data/.cody/acceptance.sh +30 -0
- data/.cody/buildspec.yml +21 -0
- data/.cody/demo.rb +38 -0
- data/.cody/project.rb +12 -0
- data/.cody/role.rb +1 -0
- data/.gitignore +2 -0
- data/.gitmodules +6 -3
- data/.travis.yml +7 -0
- data/CHANGELOG.md +10 -0
- data/Gemfile +0 -1
- data/LICENSE.txt +1 -22
- data/README.md +46 -55
- data/lib/lono.rb +20 -27
- data/lib/lono/app_file.rb +5 -0
- data/lib/lono/app_file/base.rb +19 -0
- data/lib/lono/app_file/build.rb +78 -0
- data/lib/lono/app_file/registry.rb +14 -0
- data/lib/lono/app_file/registry/item.rb +46 -0
- data/lib/lono/app_file/upload.rb +39 -0
- data/lib/lono/autoloader.rb +22 -0
- data/lib/lono/aws_services.rb +46 -0
- data/lib/lono/aws_services/util.rb +49 -0
- data/lib/lono/blueprint.rb +113 -0
- data/lib/lono/blueprint/find.rb +90 -0
- data/lib/lono/blueprint/helper.rb +18 -0
- data/lib/lono/blueprint/info.rb +10 -0
- data/lib/lono/blueprint/list.rb +14 -0
- data/lib/lono/blueprint/root.rb +43 -0
- data/lib/lono/cfn.rb +31 -19
- data/lib/lono/cfn/aws_service.rb +16 -0
- data/lib/lono/cfn/base.rb +244 -261
- data/lib/lono/cfn/create.rb +36 -32
- data/lib/lono/cfn/current.rb +1 -1
- data/lib/lono/cfn/delete.rb +2 -2
- data/lib/lono/cfn/deploy.rb +11 -0
- data/lib/lono/cfn/diff.rb +1 -1
- data/lib/lono/cfn/preview.rb +3 -3
- data/lib/lono/cfn/rollback.rb +26 -0
- data/lib/lono/cfn/status.rb +2 -203
- data/lib/lono/cfn/suffix.rb +67 -0
- data/lib/lono/cfn/update.rb +61 -53
- data/lib/lono/cli.rb +42 -23
- data/lib/lono/completer.rb +0 -2
- data/lib/lono/configure.rb +37 -0
- data/lib/lono/configure/aws_services.rb +18 -0
- data/lib/lono/configure/base.rb +94 -0
- data/lib/lono/configure/helpers.rb +128 -0
- data/lib/lono/conventions.rb +11 -0
- data/lib/lono/core.rb +42 -12
- data/lib/lono/core/config.rb +5 -4
- data/lib/lono/default/settings.yml +0 -11
- data/lib/lono/file_uploader.rb +9 -4
- data/lib/lono/help.rb +1 -2
- data/lib/lono/help/blueprint.md +46 -0
- data/lib/lono/help/cfn.md +5 -4
- data/lib/lono/help/cfn/create.md +14 -9
- data/lib/lono/help/cfn/deploy.md +92 -0
- data/lib/lono/help/cfn/diff.md +0 -1
- data/lib/lono/help/cfn/update.md +16 -15
- data/lib/lono/help/completion.md +3 -3
- data/lib/lono/help/generate.md +0 -1
- data/lib/lono/help/new.md +40 -34
- data/lib/lono/help/param.md +1 -1
- data/lib/lono/help/param/generate.md +1 -1
- data/lib/lono/help/template.md +2 -2
- data/lib/lono/help/xgraph.md +1 -1
- data/lib/lono/inspector.rb +1 -1
- data/lib/lono/inspector/base.rb +26 -10
- data/lib/lono/inspector/graph.rb +7 -3
- data/lib/lono/inspector/summary.rb +15 -3
- data/lib/lono/md5.rb +46 -0
- data/lib/lono/new.rb +40 -28
- data/lib/lono/new/helper.rb +2 -3
- data/lib/lono/param.rb +12 -11
- data/lib/lono/param/generator.rb +96 -42
- data/lib/lono/project_checker.rb +27 -8
- data/lib/lono/s3.rb +23 -0
- data/lib/lono/s3/bucket.rb +123 -0
- data/lib/lono/script.rb +4 -8
- data/lib/lono/script/base.rb +7 -2
- data/lib/lono/script/build.rb +7 -8
- data/lib/lono/script/upload.rb +4 -20
- data/lib/lono/sequence.rb +19 -16
- data/lib/lono/setting.rb +19 -27
- data/lib/lono/template.rb +22 -26
- data/lib/lono/template/base.rb +13 -0
- data/lib/lono/template/context.rb +4 -56
- data/lib/lono/template/context/loader.rb +70 -0
- data/lib/lono/template/dsl.rb +15 -151
- data/lib/lono/template/dsl/builder.rb +60 -0
- data/lib/lono/template/dsl/builder/base.rb +14 -0
- data/lib/lono/template/dsl/builder/condition.rb +26 -0
- data/lib/lono/template/dsl/builder/fn.rb +114 -0
- data/lib/lono/template/dsl/builder/helper.rb +64 -0
- data/lib/lono/template/dsl/builder/mapping.rb +24 -0
- data/lib/lono/template/dsl/builder/output.rb +37 -0
- data/lib/lono/template/dsl/builder/parameter.rb +39 -0
- data/lib/lono/template/dsl/builder/resource.rb +38 -0
- data/lib/lono/template/dsl/builder/section.rb +12 -0
- data/lib/lono/template/dsl/builder/syntax.rb +58 -0
- data/lib/lono/template/erb.rb +82 -0
- data/lib/lono/template/evaluate.rb +39 -0
- data/lib/lono/template/generator.rb +29 -0
- data/lib/lono/template/helper.rb +7 -29
- data/lib/lono/template/post_processor.rb +69 -0
- data/lib/lono/template/template.rb +4 -9
- data/lib/lono/template/upload.rb +103 -133
- data/lib/lono/template/util.rb +48 -0
- data/lib/lono/upgrade.rb +5 -3
- data/lib/lono/upgrade/upgrade5.rb +55 -0
- data/lib/lono/user_data.rb +4 -4
- data/lib/lono/version.rb +1 -1
- data/lib/templates/blueprint/%blueprint_name%.gemspec.tt +44 -0
- data/lib/templates/blueprint/.gitignore +14 -0
- data/lib/templates/blueprint/.lono/config.yml.tt +3 -0
- data/lib/templates/blueprint/.meta/config.yml.tt +3 -0
- data/lib/templates/blueprint/CHANGELOG.md +7 -0
- data/lib/templates/blueprint/Gemfile +4 -0
- data/lib/templates/blueprint/README.md +37 -0
- data/lib/templates/blueprint/Rakefile +6 -0
- data/lib/templates/blueprint/setup/configs.rb +54 -0
- data/lib/templates/blueprint_configs/configs/%blueprint_name%/params/base.txt +2 -0
- data/lib/{starter_projects/skeleton/app/definitions/base.rb → templates/blueprint_configs/configs/%blueprint_name%/params/development.txt} +0 -0
- data/lib/templates/blueprint_configs/configs/%blueprint_name%/variables/base.rb +2 -0
- data/lib/templates/blueprint_configs/configs/%blueprint_name%/variables/development.rb +0 -0
- data/lib/templates/blueprint_types/dsl/app/templates/%blueprint_name%.rb +37 -0
- data/lib/templates/blueprint_types/dsl/app/user_data/bootstrap.sh +2 -0
- data/lib/templates/blueprint_types/erb/app/definitions/base.rb.tt +1 -0
- data/lib/templates/blueprint_types/erb/app/templates/%blueprint_name%.yml +8 -0
- data/lib/{starter_projects/autoscaling → templates/skeleton}/.gitignore +1 -0
- data/lib/templates/skeleton/Gemfile +3 -0
- data/lib/{starter_projects/autoscaling → templates/skeleton}/Guardfile +2 -2
- data/lib/templates/skeleton/README.md +58 -0
- data/lib/templates/skeleton/configs/settings.yml +17 -0
- data/lib/templates/upgrade5/blueprints/main/.lono/config.yml +3 -0
- data/lib/templates/upgrade5/blueprints/main/.meta/config.yml +3 -0
- data/lono.gemspec +12 -8
- data/vendor/cfn-status/CHANGELOG.md +10 -0
- data/vendor/cfn-status/Gemfile +4 -0
- data/vendor/cfn-status/LICENSE.txt +21 -0
- data/vendor/cfn-status/README.md +56 -0
- data/vendor/cfn-status/Rakefile +6 -0
- data/vendor/cfn-status/bin/console +14 -0
- data/vendor/cfn-status/bin/setup +8 -0
- data/vendor/cfn-status/cfn-status.gemspec +30 -0
- data/vendor/cfn-status/lib/cfn-status.rb +1 -0
- data/vendor/cfn-status/lib/cfn/aws_service.rb +51 -0
- data/vendor/cfn-status/lib/cfn/status.rb +219 -0
- data/vendor/cfn-status/lib/cfn/status/version.rb +5 -0
- data/vendor/cfn-status/spec/cfn/status_spec.rb +81 -0
- data/vendor/cfn-status/spec/fixtures/cfn/stack-events-complete.json +1080 -0
- data/vendor/cfn-status/spec/fixtures/cfn/stack-events-in-progress.json +1080 -0
- data/vendor/cfn-status/spec/fixtures/cfn/stack-events-update-rollback-complete.json +1086 -0
- data/vendor/cfn-status/spec/spec_helper.rb +14 -0
- data/vendor/cfn_camelizer/CHANGELOG.md +20 -0
- data/vendor/cfn_camelizer/Gemfile +4 -0
- data/vendor/cfn_camelizer/LICENSE.txt +21 -0
- data/vendor/cfn_camelizer/README.md +40 -0
- data/vendor/cfn_camelizer/Rakefile +6 -0
- data/vendor/cfn_camelizer/bin/console +14 -0
- data/vendor/cfn_camelizer/bin/setup +8 -0
- data/vendor/cfn_camelizer/cfn_camelizer.gemspec +32 -0
- data/vendor/cfn_camelizer/lib/camelizer.yml +37 -0
- data/vendor/cfn_camelizer/lib/cfn_camelizer.rb +94 -0
- data/vendor/cfn_camelizer/lib/cfn_camelizer/version.rb +3 -0
- data/vendor/cfn_camelizer/spec/cfn_camelizer_spec.rb +86 -0
- data/vendor/cfn_camelizer/spec/spec_helper.rb +14 -0
- metadata +189 -62
- data/.circleci/bin/commit_docs.sh +0 -26
- data/.circleci/config.yml +0 -72
- data/bin/release +0 -9
- data/lib/lono/help/import.md +0 -54
- data/lib/lono/importer.rb +0 -134
- data/lib/lono/new/message.rb +0 -35
- data/lib/starter_projects/autoscaling/Gemfile +0 -3
- data/lib/starter_projects/autoscaling/README.md +0 -118
- data/lib/starter_projects/autoscaling/app/definitions/base.rb +0 -2
- data/lib/starter_projects/autoscaling/app/templates/autoscaling.yml +0 -682
- data/lib/starter_projects/autoscaling/config/params/base/autoscaling.txt +0 -6
- data/lib/starter_projects/autoscaling/config/settings.yml +0 -33
- data/lib/starter_projects/ec2/.gitignore +0 -2
- data/lib/starter_projects/ec2/Gemfile +0 -3
- data/lib/starter_projects/ec2/Guardfile +0 -12
- data/lib/starter_projects/ec2/README.md +0 -86
- data/lib/starter_projects/ec2/app/definitions/base.rb +0 -2
- data/lib/starter_projects/ec2/app/definitions/development.rb +0 -1
- data/lib/starter_projects/ec2/app/definitions/production.rb +0 -1
- data/lib/starter_projects/ec2/app/helpers/my_custom_helper.rb +0 -17
- data/lib/starter_projects/ec2/app/partials/user_data/bootstrap.sh +0 -4
- data/lib/starter_projects/ec2/app/templates/example.yml +0 -430
- data/lib/starter_projects/ec2/config/params/base/example.txt +0 -2
- data/lib/starter_projects/ec2/config/params/development/example.txt +0 -3
- data/lib/starter_projects/ec2/config/params/production/example.txt +0 -2
- data/lib/starter_projects/ec2/config/settings.yml +0 -33
- data/lib/starter_projects/ec2/config/variables/base.rb +0 -3
- data/lib/starter_projects/ec2/config/variables/development.rb +0 -2
- data/lib/starter_projects/ec2/config/variables/production.rb +0 -2
- data/lib/starter_projects/ec2/welcome.txt +0 -8
- data/lib/starter_projects/skeleton/.gitignore +0 -2
- data/lib/starter_projects/skeleton/Gemfile +0 -3
- data/lib/starter_projects/skeleton/Guardfile +0 -12
- data/lib/starter_projects/skeleton/README.md +0 -53
- data/lib/starter_projects/skeleton/config/settings.yml +0 -33
- data/lib/starter_projects/skeleton/welcome.txt +0 -7
- data/vendor/plissken/Gemfile +0 -14
- data/vendor/plissken/LICENSE.txt +0 -20
- data/vendor/plissken/README.md +0 -46
- data/vendor/plissken/Rakefile +0 -56
- data/vendor/plissken/VERSION +0 -1
- data/vendor/plissken/lib/plissken.rb +0 -1
- data/vendor/plissken/lib/plissken/ext/hash/to_snake_keys.rb +0 -45
- data/vendor/plissken/plissken.gemspec +0 -61
- data/vendor/plissken/spec/lib/to_snake_keys_spec.rb +0 -177
- data/vendor/plissken/spec/spec_helper.rb +0 -90
- data/vendor/plissken/test/helper.rb +0 -20
- data/vendor/plissken/test/plissken/ext/hash/to_snake_keys_test.rb +0 -184
- data/vendor/plissken/test/test_plissken.rb +0 -2
@@ -0,0 +1,11 @@
|
|
1
|
+
module Lono
|
2
|
+
module Conventions
|
3
|
+
# Think can make this a module, but need to figure out how it fits with lono cfn
|
4
|
+
def template_param_convention(options)
|
5
|
+
options = options.deep_symbolize_keys
|
6
|
+
template = options[:template] || @blueprint
|
7
|
+
param = options[:param] || template || @blueprint
|
8
|
+
[template, param]
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/lono/core.rb
CHANGED
@@ -3,26 +3,42 @@ require 'pathname'
|
|
3
3
|
module Lono
|
4
4
|
module Core
|
5
5
|
extend Memoist
|
6
|
-
autoload :Config, 'lono/core/config'
|
7
6
|
|
8
7
|
def config
|
9
8
|
Config.new
|
10
9
|
end
|
11
10
|
memoize :config
|
12
11
|
|
12
|
+
@@root = nil
|
13
13
|
def root
|
14
|
-
path = ENV['LONO_ROOT'] ||
|
14
|
+
path = @@root || ENV['LONO_ROOT'] || Dir.pwd
|
15
15
|
Pathname.new(path)
|
16
16
|
end
|
17
17
|
memoize :root
|
18
18
|
|
19
|
+
@@blueprint_root = nil
|
20
|
+
def blueprint_root; @@blueprint_root ; end
|
21
|
+
def blueprint_root=(v) ; @@blueprint_root = v ; end
|
22
|
+
|
19
23
|
def env
|
20
|
-
|
21
|
-
|
22
|
-
|
24
|
+
# 2-way binding
|
25
|
+
env = env_from_profile(ENV['AWS_PROFILE']) || 'development'
|
26
|
+
env = ENV['LONO_ENV'] if ENV['LONO_ENV'] # highest precedence
|
27
|
+
env
|
23
28
|
end
|
24
29
|
memoize :env
|
25
30
|
|
31
|
+
# Overrides AWS_PROFILE based on the Lono.env if set in configs/settings.yml
|
32
|
+
# 2-way binding.
|
33
|
+
def set_aws_profile!
|
34
|
+
return unless settings # Only load if within lono project and there's a settings.yml
|
35
|
+
data = settings[Lono.env] || {}
|
36
|
+
if data["aws_profile"]
|
37
|
+
# puts "Using AWS_PROFILE=#{data["aws_profile"]} from LONO_ENV=#{Lono.env} in configs/settings.yml"
|
38
|
+
ENV['AWS_PROFILE'] = data["aws_profile"]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
26
42
|
# Precedence (highest to lowest)
|
27
43
|
# 1. LONO_SUFFIX
|
28
44
|
# 2. .current/lono
|
@@ -40,15 +56,29 @@ module Lono
|
|
40
56
|
end
|
41
57
|
memoize :suffix
|
42
58
|
|
43
|
-
|
44
|
-
# Do not use the Setting class to load the profile because it can cause an
|
59
|
+
# Do not use the Setting#data to load the profile because it can cause an
|
45
60
|
# infinite loop then if we decide to use Lono.env from within settings class.
|
61
|
+
def settings
|
62
|
+
setting = Setting.new(false) # check_lono_project to account for `lono new`
|
63
|
+
settings_path = setting.lookup_project_settings_path
|
64
|
+
return unless settings_path # in case outside of lono project
|
65
|
+
|
66
|
+
YAML.load_file(settings_path)
|
67
|
+
end
|
68
|
+
memoize :settings
|
69
|
+
|
70
|
+
def pro_version
|
71
|
+
installed = Gem::Specification.detect { |spec| spec.name == 'lono-pro' }
|
72
|
+
installed ? Lono::Pro::VERSION : "not installed"
|
73
|
+
end
|
74
|
+
|
75
|
+
private
|
46
76
|
def env_from_profile(aws_profile)
|
47
|
-
|
48
|
-
env =
|
49
|
-
|
50
|
-
profiles =
|
51
|
-
profiles && profiles
|
77
|
+
return unless settings
|
78
|
+
env = settings.find do |_env, settings|
|
79
|
+
settings ||= {}
|
80
|
+
profiles = settings['aws_profile']
|
81
|
+
profiles && profiles == aws_profile
|
52
82
|
end
|
53
83
|
env.first if env
|
54
84
|
end
|
data/lib/lono/core/config.rb
CHANGED
@@ -7,14 +7,15 @@ module Lono::Core
|
|
7
7
|
scripts_path: "app/scripts",
|
8
8
|
templates_path: "app/templates",
|
9
9
|
user_data_path: "app/user_data",
|
10
|
-
params_path: "config/params",
|
11
|
-
variables_path: "config/variables",
|
12
|
-
output_path: "output",
|
13
10
|
}
|
14
11
|
PATHS.each do |meth, path|
|
15
12
|
define_method meth do
|
16
|
-
"#{Lono.
|
13
|
+
"#{Lono.blueprint_root}/#{path}"
|
17
14
|
end
|
18
15
|
end
|
16
|
+
|
17
|
+
def output_path
|
18
|
+
"#{Lono.root}/output"
|
19
|
+
end
|
19
20
|
end
|
20
21
|
end
|
@@ -7,19 +7,8 @@ base:
|
|
7
7
|
# extract_scripts:
|
8
8
|
# to: "/opt"
|
9
9
|
# as: "ec2-user"
|
10
|
-
# If s3_folder is set then the generated templates and app/scripts will automatically
|
11
|
-
# be uploaded to s3.
|
12
|
-
# There are 2 formats for s3_folder:
|
13
|
-
# Format 1:
|
14
|
-
# s3_folder: mybucket/path/to/folder # simple string
|
15
|
-
# Format 2:
|
16
|
-
# s3_folder: # Hash options in order to support multiple AWS_PROFILEs
|
17
|
-
# default: mybucket/folder
|
18
|
-
# aws_profile1: mybucket/folder
|
19
|
-
# aws_profile2: another-bucket/storage/folder
|
20
10
|
# stack_name_suffix: random # tack on a 3 char random string at the end of the stack name for lono cfn create
|
21
11
|
|
22
|
-
|
23
12
|
development:
|
24
13
|
# When you have AWS_PROFILE set to one of these values, lono will switch to the desired
|
25
14
|
# environment. This prevents you from switching AWS_PROFILE, forgetting to
|
data/lib/lono/file_uploader.rb
CHANGED
@@ -3,17 +3,17 @@ module Lono
|
|
3
3
|
include Lono::Template::AwsService
|
4
4
|
extend Memoist
|
5
5
|
|
6
|
-
def initialize(options={})
|
7
|
-
@options = options
|
6
|
+
def initialize(blueprint, options={})
|
7
|
+
@blueprint, @options = blueprint, options
|
8
8
|
@checksums = {}
|
9
|
-
@prefix = "#{folder_key}/#{Lono.env}/files" # s3://s3-bucket/folder/development/files
|
9
|
+
@prefix = "#{folder_key}/#{Lono.env}/#{blueprint}/files" # s3://s3-bucket/folder/development/files
|
10
10
|
end
|
11
11
|
|
12
12
|
def upload_all
|
13
13
|
puts "Uploading app/files..."
|
14
14
|
load_checksums!
|
15
15
|
|
16
|
-
pattern = "#{Lono.
|
16
|
+
pattern = "#{Lono.blueprint_root}/app/files/**/*"
|
17
17
|
Dir.glob(pattern).each do |path|
|
18
18
|
next if ::File.directory?(path)
|
19
19
|
s3_upload(path)
|
@@ -50,7 +50,12 @@ module Lono
|
|
50
50
|
"#{key}-#{md5}.#{ext}"
|
51
51
|
end
|
52
52
|
|
53
|
+
# Inputs:
|
54
|
+
#
|
55
|
+
# path: can be full path or relative path
|
56
|
+
#
|
53
57
|
def s3_upload(path)
|
58
|
+
path = path.gsub("#{Lono.root}/",'') # remove Lono.root
|
54
59
|
pretty_path = path.sub(/^\.\//, '')
|
55
60
|
key = md5_key(path)
|
56
61
|
s3_full_path = "s3://#{s3_bucket}/#{key}"
|
data/lib/lono/help.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
module Lono::Help
|
2
2
|
class << self
|
3
|
-
# namespaced_command: cfn/create or cfn:create
|
4
|
-
# both work.
|
3
|
+
# namespaced_command: cfn/create or cfn:create both work.
|
5
4
|
def text(namespaced_command)
|
6
5
|
path = namespaced_command.to_s.gsub(':','/')
|
7
6
|
path = File.expand_path("../help/#{path}.md", __FILE__)
|
@@ -0,0 +1,46 @@
|
|
1
|
+
## Examples
|
2
|
+
|
3
|
+
lono blueprint ec2 # skeleton blueprint with barebones structure
|
4
|
+
|
5
|
+
## Example Output
|
6
|
+
|
7
|
+
$ lono blueprint ec2
|
8
|
+
=> Creating new blueprint called ec2.
|
9
|
+
create ec2
|
10
|
+
create ec2/ec2.gemspec
|
11
|
+
create ec2/.gitignore
|
12
|
+
create ec2/Gemfile
|
13
|
+
create ec2/README.md
|
14
|
+
create ec2/app/definitions/base.rb
|
15
|
+
create ec2/setup/configs.rb
|
16
|
+
create ec2/app/templates
|
17
|
+
=> Initialize git repo
|
18
|
+
run git init from "."
|
19
|
+
Initialized empty Git repository in /home/ec2-user/environment/boltopspro/blueprints/ec2/.git/
|
20
|
+
=> Installing dependencies with: bundle install
|
21
|
+
================================================================
|
22
|
+
Congrats You have successfully created a lono blueprint.
|
23
|
+
|
24
|
+
Cd into your blueprint and check things out.
|
25
|
+
|
26
|
+
cd ec2
|
27
|
+
|
28
|
+
More info: https://lono.cloud/docs/core/blueprints
|
29
|
+
|
30
|
+
Here's the structure your blueprint:
|
31
|
+
|
32
|
+
.
|
33
|
+
├── app
|
34
|
+
│ ├── definitions
|
35
|
+
│ │ └── base.rb
|
36
|
+
│ └── templates
|
37
|
+
├── ec2.gemspec
|
38
|
+
├── Gemfile
|
39
|
+
├── Gemfile.lock
|
40
|
+
├── README.md
|
41
|
+
└── setup
|
42
|
+
└── configs.rb
|
43
|
+
|
44
|
+
4 directories, 6 files
|
45
|
+
|
46
|
+
$
|
data/lib/lono/help/cfn.md
CHANGED
data/lib/lono/help/cfn/create.md
CHANGED
@@ -1,21 +1,26 @@
|
|
1
1
|
## Examples
|
2
2
|
|
3
|
-
Provided that you are in a lono project and have a `
|
3
|
+
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:
|
4
4
|
|
5
|
-
|
5
|
+
lono cfn create demo
|
6
6
|
|
7
|
-
The above command will generate
|
7
|
+
The above command will generate:
|
8
|
+
|
9
|
+
* template: output/demo/templates/demo.yml
|
10
|
+
* parameters: output/demo/params/development.json
|
11
|
+
|
12
|
+
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.
|
8
13
|
|
9
14
|
Here are examples of overriding the template and params name conventions.
|
10
15
|
|
11
|
-
|
16
|
+
lono cfn create demo --template different1
|
12
17
|
|
13
|
-
The template used is `
|
18
|
+
The template used is `app/templates/different1.rb` and the parameters used is `configs/demo/params/development/demo/different1.txt`.
|
14
19
|
|
15
|
-
|
20
|
+
lono cfn create demo --param different2
|
16
21
|
|
17
|
-
The template used is `
|
22
|
+
The template used is `app/templates/demo.rb` and the parameters used is `configs/demo/params/development/demo/different2.json`.
|
18
23
|
|
19
|
-
|
24
|
+
lono cfn create demo --template different3 --param different4
|
20
25
|
|
21
|
-
The template used is `
|
26
|
+
The template used is `app/templates/different3.rb` and the parameters used is `configs/demo/params/different3/different4.json`.
|
@@ -0,0 +1,92 @@
|
|
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
|
+
|
3
|
+
# Examples
|
4
|
+
|
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
|
+
|
7
|
+
lono cfn deploy demo
|
8
|
+
|
9
|
+
The above command will generate:
|
10
|
+
|
11
|
+
* template: output/demo/templates/demo.yml
|
12
|
+
* parameters: output/demo/params/development.json
|
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
|
+
|
16
|
+
## Convention: Stack, Blueprint, Template and Parameter are All the Same
|
17
|
+
|
18
|
+
Let's say you have a blueprint in `blueprints/demo` with a structure the looks something like this:
|
19
|
+
|
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
|
32
|
+
|
33
|
+
The command:
|
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
|
data/lib/lono/help/cfn/diff.md
CHANGED
data/lib/lono/help/cfn/update.md
CHANGED
@@ -2,9 +2,7 @@
|
|
2
2
|
|
3
3
|
Let's say we make a simple change to a template, like changing the default InstanceType from `t2.small` to `t2.micro`. Here's what happens when you run `lono cfn update`
|
4
4
|
|
5
|
-
|
6
|
-
lono cfn update ec2
|
7
|
-
```
|
5
|
+
lono cfn update ec2
|
8
6
|
|
9
7
|
The output should look similiar to this:
|
10
8
|
|
@@ -19,30 +17,33 @@ You are prompted with an "Are you sure?" confirmation before lono continues.
|
|
19
17
|
|
20
18
|
By default, the update command will display a preview of the stack changes before applying the update and prompt to check if you are sure. If you want to bypass the are you sure prompt, use the `--sure` option.
|
21
19
|
|
22
|
-
|
23
|
-
lono cfn update ec2 --sure
|
24
|
-
```
|
20
|
+
lono cfn update ec2 --sure
|
25
21
|
|
26
22
|
## Conventions: template and param
|
27
23
|
|
28
24
|
Lono follows some [coventions](http://lono.cloud/docs/conventions/) that helps keep the commands short. We'll go through an example to explain:
|
29
25
|
|
30
|
-
Provided that you are in a lono project and have a `
|
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:
|
31
27
|
|
32
|
-
|
28
|
+
lono cfn update demo
|
33
29
|
|
34
|
-
The above command will generate
|
30
|
+
The above command will generate:
|
31
|
+
|
32
|
+
* template: output/demo/templates/demo.yml
|
33
|
+
* parameters: output/demo/params/development.json
|
34
|
+
|
35
|
+
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.
|
35
36
|
|
36
37
|
Here are examples of overriding the template and params name conventions.
|
37
38
|
|
38
|
-
|
39
|
+
lono cfn update demo --template different1
|
39
40
|
|
40
|
-
The template used is `
|
41
|
+
The template used is `app/templates/different1.rb` and the parameters used is `configs/demo/params/development/demo/different1.txt`.
|
41
42
|
|
42
|
-
|
43
|
+
lono cfn update demo --param different2
|
43
44
|
|
44
|
-
The template used is `
|
45
|
+
The template used is `app/templates/demo.rb` and the parameters used is `configs/demo/params/development/demo/different2.json`.
|
45
46
|
|
46
|
-
|
47
|
+
lono cfn update demo --template different3 --param different4
|
47
48
|
|
48
|
-
The template used is `
|
49
|
+
The template used is `app/templates/different3.rb` and the parameters used is `configs/demo/params/different3/different4.json`.
|
data/lib/lono/help/completion.md
CHANGED
@@ -8,7 +8,7 @@ Prints words for TAB auto-completion.
|
|
8
8
|
|
9
9
|
lono completion
|
10
10
|
lono completion cfn
|
11
|
-
lono completion cfn
|
11
|
+
lono completion cfn deploy
|
12
12
|
|
13
13
|
To enable, TAB auto-completion add the following to your profile:
|
14
14
|
|
@@ -18,5 +18,5 @@ Auto-completion example usage:
|
|
18
18
|
|
19
19
|
lono [TAB]
|
20
20
|
lono cfn [TAB]
|
21
|
-
lono cfn
|
22
|
-
lono cfn
|
21
|
+
lono cfn deploy [TAB]
|
22
|
+
lono cfn deploy --[TAB]
|