cfhighlander 0.2.1.alpha.16 → 0.2.1.alpha.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -19
- data/bin/cfhighlander +1 -1
- data/bin/{highlander.rb → cfhighlander.rb} +9 -4
- data/lib/highlander.compiler.rb +1 -1
- data/lib/highlander.dsl.rb +4 -1
- data/lib/highlander.factory.rb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a7d7d97f9d94570594d6c075bd489aa6ae3058d6ce7c096a532ea65288c9de0
|
4
|
+
data.tar.gz: 19df3d0459ef71885b3f9e85f7067e2bcf73d7fc9e612af579d72a0fe59f1ad3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32eefcd197e05029a8d176dffef997238aa794fdd51684d31e9099d919e0bba9fe42ec7182f87c74437d074b91c0e3d4ab261b8624c8057e33c0595f960e473b
|
7
|
+
data.tar.gz: c3521f255a7f6509524b2df2e8a72289d6912375fd13a98e7270c38858db4dbcb9b0d08a723cff1603102fdf621ffa11c741c2f3a65d0af22f765390f272a309
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
[![Build Status](https://travis-ci.com/theonestack/cfhighlander.svg?branch=develop)](https://travis-ci.com/theonestack/cfhighlander)
|
2
2
|
|
3
|
-
#
|
3
|
+
# Cfhighlander
|
4
4
|
|
5
|
-
|
5
|
+
Cfhighlander is DSL processor that enables composition and orchestration of Amazon CloudFormation templates
|
6
6
|
written using [CfnDsl](https://github.com/cfndsl/cfndsl) in an abstract way. It tries to tackle problem of merging multiple templates into master
|
7
7
|
template in an elegant way, so higher degree of template reuse can be achieved. It does so by formalising commonly
|
8
8
|
used patterns via DSL statements. For an example, passing output of one stack into other stack is achieved using
|
@@ -48,7 +48,7 @@ this file defines map used within component itself
|
|
48
48
|
- Define cfndsl template used for building CloudFormation resources
|
49
49
|
|
50
50
|
|
51
|
-
**Outer component** is component that defines other component via
|
51
|
+
**Outer component** is component that defines other component via cfhighlander dsl `Component` statement. Defined component
|
52
52
|
is called **inner component**. Components defined under same outer component are **sibling components**
|
53
53
|
|
54
54
|
## Usage
|
@@ -58,30 +58,30 @@ For both ways, highlander is distributed as ruby gem
|
|
58
58
|
|
59
59
|
|
60
60
|
```bash
|
61
|
-
$ gem install
|
62
|
-
$
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
61
|
+
$ gem install cfhighlander
|
62
|
+
$ cfhighlander help
|
63
|
+
cfhighlander commands:
|
64
|
+
cfhighlander cfcompile component[@version] -f, --format=FORMAT # Compile Highlander component to CloudFormation templates
|
65
|
+
cfhighlander cfpublish component[@version] -f, --format=FORMAT # Publish CloudFormation template for component, and it' referenced subcomponents
|
66
|
+
cfhighlander configcompile component[@version] # Compile Highlander components configuration
|
67
|
+
cfhighlander dslcompile component[@version] -f, --format=FORMAT # Compile Highlander component configuration and create cfndsl templates
|
68
|
+
cfhighlander help [COMMAND] # Describe available commands or one specific command
|
69
|
+
cfhighlander publish component[@version] [-v published_version] # Publish CloudFormation template for component, and it' referenced subcomponents
|
70
70
|
|
71
71
|
```
|
72
72
|
### Working directory
|
73
73
|
|
74
74
|
All templates and configuration generated are placed in `$WORKDIR/out` directory. Optionally, you can alter working directory
|
75
|
-
via `
|
75
|
+
via `CFHIGHLANDER_WORKDIR` environment variable.
|
76
76
|
|
77
77
|
### Commands
|
78
78
|
|
79
79
|
To get full list of options for any of cli commands use `highlander help command_name` syntax
|
80
80
|
|
81
81
|
```bash
|
82
|
-
$
|
82
|
+
$ cfhighlander help publish
|
83
83
|
Usage:
|
84
|
-
|
84
|
+
cfhighlander publish component[@version] [-v published_version]
|
85
85
|
|
86
86
|
Options:
|
87
87
|
[--dstbucket=DSTBUCKET] # Distribution S3 bucket
|
@@ -95,7 +95,7 @@ Publish CloudFormation template for component,
|
|
95
95
|
|
96
96
|
#### Silent mode
|
97
97
|
|
98
|
-
|
98
|
+
Cfhighlander DSL processor has built-in support for packaging and deploying AWS Lambda functions. Some of these lambda
|
99
99
|
functions may require shell command to be executed (e.g. pulling library dependencies) prior their packaging in ZIP archive format.
|
100
100
|
Such commands are potential security risk, as they allow execution of arbitrary code, so for this reason user agreement is required
|
101
101
|
e.g:
|
@@ -136,11 +136,11 @@ cfndsl templates. Check component configuration section for more details.
|
|
136
136
|
|
137
137
|
#### dslcompile
|
138
138
|
|
139
|
-
*dslcompile* will produce intermediary cfndsl templates. This is useful for debugging
|
139
|
+
*dslcompile* will produce intermediary cfndsl templates. This is useful for debugging cfhighlander components
|
140
140
|
|
141
141
|
#### publish
|
142
142
|
|
143
|
-
*publish* command publishes
|
143
|
+
*publish* command publishes cfhighlander components source code to s3 location (compared to *cfpublish* which is publishing
|
144
144
|
compiled cloudformation templates). Same CLI / DSL options apply as for *cfpublish* command. Version defaults to `latest`
|
145
145
|
|
146
146
|
|
@@ -408,4 +408,4 @@ so extension methods can be consumed within cfndsl template.
|
|
408
408
|
|
409
409
|
Any extensions placed within `cfndsl_ext` folder will be
|
410
410
|
available in cfndsl templates of all components. Any extensions placed within `hl_ext` folder are
|
411
|
-
available in
|
411
|
+
available in cfhighlander templates of all components.
|
data/bin/cfhighlander
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
require 'thor'
|
11
11
|
require 'rubygems'
|
12
|
-
require_relative '../lib
|
12
|
+
require_relative '../lib/highlander.compiler'
|
13
13
|
require_relative '../lib/highlander.factory'
|
14
14
|
require_relative '../lib/highlander.publisher'
|
15
15
|
require_relative '../lib/highlander.validator'
|
@@ -138,9 +138,7 @@ end
|
|
138
138
|
|
139
139
|
# build component from passed cli options
|
140
140
|
def build_component(options, component_name)
|
141
|
-
|
142
|
-
ENV['HIGHLANDER_WORKDIR'] = Dir.pwd
|
143
|
-
end
|
141
|
+
|
144
142
|
component_version = options[:version]
|
145
143
|
distribution_bucket = options[:dstbucket]
|
146
144
|
distribution_prefix = options[:dstprefix]
|
@@ -155,4 +153,11 @@ def build_component(options, component_name)
|
|
155
153
|
component
|
156
154
|
end
|
157
155
|
|
156
|
+
if ENV['CFHIGHLANDER_WORKDIR'].nil?
|
157
|
+
ENV['CFHIGHLANDER_WORKDIR'] = Dir.pwd
|
158
|
+
end
|
159
|
+
if ENV['HIGHLANDER_WORKDIR'].nil?
|
160
|
+
ENV['HIGHLANDER_WORKDIR'] = Dir.pwd
|
161
|
+
end
|
162
|
+
|
158
163
|
HighlanderCli.start
|
data/lib/highlander.compiler.rb
CHANGED
data/lib/highlander.dsl.rb
CHANGED
@@ -397,7 +397,6 @@ def HighlanderComponent(&block)
|
|
397
397
|
puts "Processing higlander component #{@name}\n\tLocation:#{@highlander_dsl_path}" +
|
398
398
|
"\n\tConfig:#{@config}"
|
399
399
|
|
400
|
-
component_config = @config
|
401
400
|
|
402
401
|
instance.config = @config
|
403
402
|
|
@@ -426,3 +425,7 @@ def HighlanderComponent(&block)
|
|
426
425
|
|
427
426
|
return instance
|
428
427
|
end
|
428
|
+
|
429
|
+
def CfhighlanderComponent(&block)
|
430
|
+
HighlanderComponent(&block)
|
431
|
+
end
|
data/lib/highlander.factory.rb
CHANGED
@@ -2,7 +2,7 @@ require_relative './highlander.dsl'
|
|
2
2
|
require 'fileutils'
|
3
3
|
require 'git'
|
4
4
|
|
5
|
-
LOCAL_HIGHLANDER_CACHE_LOCATION = "#{ENV['HOME']}/.
|
5
|
+
LOCAL_HIGHLANDER_CACHE_LOCATION = "#{ENV['HOME']}/.cfhighlander/components"
|
6
6
|
|
7
7
|
module Highlander
|
8
8
|
|
@@ -40,6 +40,7 @@ module Highlander
|
|
40
40
|
def load_config()
|
41
41
|
@config = {} if @config.nil?
|
42
42
|
Dir["#{@component_dir}/*.config.yaml"].each do |config_file|
|
43
|
+
puts "Loading config for #{@name}:\n\tread #{config_file} "
|
43
44
|
partial_config = YAML.load(File.read(config_file))
|
44
45
|
unless partial_config.nil?
|
45
46
|
@config.extend(partial_config)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfhighlander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.1.alpha.
|
4
|
+
version: 0.2.1.alpha.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikola Tosic
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-05-
|
12
|
+
date: 2018-05-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: highline
|
@@ -214,7 +214,7 @@ extra_rdoc_files: []
|
|
214
214
|
files:
|
215
215
|
- README.md
|
216
216
|
- bin/cfhighlander
|
217
|
-
- bin/
|
217
|
+
- bin/cfhighlander.rb
|
218
218
|
- cfndsl_ext/config/managed_policies.yaml
|
219
219
|
- cfndsl_ext/iam_helper.rb
|
220
220
|
- cfndsl_ext/lambda_helper.rb
|