kurgan 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +1 -1
- data/kurgan.gemspec +1 -1
- data/lib/kurgan.rb +4 -0
- data/lib/kurgan/add.rb +3 -3
- data/lib/kurgan/component.rb +3 -7
- data/lib/kurgan/templates/test.yaml.tt +6 -0
- data/lib/kurgan/templates/travis.yml.tt +2 -2
- data/lib/kurgan/test.rb +32 -0
- data/lib/kurgan/version.rb +1 -1
- metadata +7 -6
- data/lib/kurgan/templates/sns_topic.test.yaml.tt +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85a9e2245bfe3886184f93bae66f16c5f8b565354ada5319f9ce5e0c40fd9775
|
4
|
+
data.tar.gz: 5e8ae3b2bd577f44ee6c0f11999a67dbb3674a3f07c4d52c7f88a1f50bd08fae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c610c92985b8211e380fcd6597ed24a151af72eda13142812618ac37db87d7c9328757b2d94e3fb3ff3c0c5710af129226eaa827d062ea1551c3a23acacc6917
|
7
|
+
data.tar.gz: ff7b9e28fa2496a129f1dbbcff7157b52ce394dcadad23fd1992c3702c6c8e7ae2e4f3aa343d41260d575492c80760ded2c1c665aa9e3d8fe7019014e366a9d0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
kurgan (0.
|
4
|
+
kurgan (0.2.0)
|
5
5
|
thor (~> 0.19)
|
6
6
|
|
7
7
|
GEM
|
@@ -14,9 +14,9 @@ PLATFORMS
|
|
14
14
|
ruby
|
15
15
|
|
16
16
|
DEPENDENCIES
|
17
|
-
bundler (~>
|
17
|
+
bundler (~> 2.0)
|
18
18
|
kurgan!
|
19
19
|
rake (~> 10.0)
|
20
20
|
|
21
21
|
BUNDLED WITH
|
22
|
-
|
22
|
+
2.0.1
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Kurgan
|
2
2
|
---
|
3
3
|
|
4
|
-
[![Build Status](https://travis-ci.
|
4
|
+
[![Build Status](https://travis-ci.com/theonestack/kurgan.svg?branch=master)](https://travis-ci.com/theonestack/kurgan) [![Join the chat at https://gitter.im/theonestack/cfhighlander](https://badges.gitter.im/theonestack/cfhighlander.svg)](https://gitter.im/theonestack/cfhighlander?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
5
5
|
|
6
6
|
Tool to manage CfHighlander stacks
|
7
7
|
|
data/kurgan.gemspec
CHANGED
data/lib/kurgan.rb
CHANGED
@@ -5,6 +5,7 @@ require 'kurgan/globals'
|
|
5
5
|
require "kurgan/init"
|
6
6
|
require "kurgan/component"
|
7
7
|
require "kurgan/add"
|
8
|
+
require "kurgan/test"
|
8
9
|
require "kurgan/list"
|
9
10
|
|
10
11
|
module Kurgan
|
@@ -25,6 +26,9 @@ module Kurgan
|
|
25
26
|
register Kurgan::Add, 'add', 'add [component]', 'Adds a new component to an existing CfHighlander project'
|
26
27
|
tasks["add"].options = Kurgan::Add.class_options
|
27
28
|
|
29
|
+
register Kurgan::Test, 'test', 'test [name]', 'Create a new test case for a component'
|
30
|
+
tasks["test"].options = Kurgan::Test.class_options
|
31
|
+
|
28
32
|
desc "list", "List available components and latest version from theonestack github"
|
29
33
|
method_option :filter, aliases: '-f', type: :string, desc: "filter components by service type"
|
30
34
|
method_option :component, aliases: '-c', type: :string, desc: "list all versions for matched components"
|
data/lib/kurgan/add.rb
CHANGED
@@ -2,7 +2,7 @@ module Kurgan
|
|
2
2
|
class Add < Thor::Group
|
3
3
|
include Thor::Actions
|
4
4
|
|
5
|
-
argument :
|
5
|
+
argument :component
|
6
6
|
|
7
7
|
class_option :name, aliases: :n, type: :string
|
8
8
|
class_option :version, aliases: :v, type: :string
|
@@ -15,11 +15,11 @@ module Kurgan
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def get_component_name
|
18
|
-
@name = options[:name] ||
|
18
|
+
@name = options[:name] || component
|
19
19
|
end
|
20
20
|
|
21
21
|
def get_template_version
|
22
|
-
@template = options[:version] ? "#{
|
22
|
+
@template = options[:version] ? "#{component}@#{options[:version]}" : component
|
23
23
|
say "adding #{@template} to the #{@cfhighlander_template.split('.')[0]} project"
|
24
24
|
end
|
25
25
|
|
data/lib/kurgan/component.rb
CHANGED
@@ -27,13 +27,9 @@ module Kurgan
|
|
27
27
|
template('templates/cfndsl.rb.tt', "#{@dir}/#{name}.cfndsl.rb")
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
31
|
-
|
32
|
-
|
33
|
-
template('templates/sns_topic.test.yaml.tt', "#{@dir}/tests/sns_topic.test.yaml")
|
34
|
-
else
|
35
|
-
say "Skipping tests", :yellow
|
36
|
-
end
|
30
|
+
def create_default_config_test
|
31
|
+
@test_name = 'default'
|
32
|
+
template('templates/test.yaml.tt', "#{@dir}/tests/#{@test_name}.test.yaml")
|
37
33
|
end
|
38
34
|
|
39
35
|
def copy_licence
|
@@ -7,9 +7,9 @@ before_script:
|
|
7
7
|
- cfndsl -u
|
8
8
|
<%- if @type == 'component' -%>
|
9
9
|
script:
|
10
|
-
- cfhighlander cftest
|
10
|
+
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then cfhighlander cftest --no-validate; else cfhighlander cftest; fi
|
11
11
|
- cfn_nag_scan -i out/tests
|
12
12
|
<%- elsif @type == 'project' -%>
|
13
13
|
script:
|
14
|
-
-
|
14
|
+
- cfcompile
|
15
15
|
<%- end -%>
|
data/lib/kurgan/test.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
module Kurgan
|
2
|
+
class Test < Thor::Group
|
3
|
+
include Thor::Actions
|
4
|
+
|
5
|
+
argument :test_name
|
6
|
+
|
7
|
+
class_option :type, aliases: :t, type: :string, enum: %w(config), default: 'config'
|
8
|
+
class_option :directory, aliases: :d, type: :string, default: 'tests'
|
9
|
+
|
10
|
+
def self.source_root
|
11
|
+
File.dirname(__FILE__)
|
12
|
+
end
|
13
|
+
|
14
|
+
def get_cfhighlander_template
|
15
|
+
@cfhighlander_template = Dir['*.cfhighlander.rb'][0]
|
16
|
+
if @cfhighlander_template.nil?
|
17
|
+
raise "No cfhighlander.rb file found in #{Dir.pwd}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def create_test
|
22
|
+
case options[:type]
|
23
|
+
when 'config'
|
24
|
+
template('templates/test.yaml.tt', "#{options[:directory]}/#{test_name}.test.yaml")
|
25
|
+
say "created config test case #{options[:directory]}/#{test_name}.test.yaml", :green
|
26
|
+
else
|
27
|
+
error "#{options[:type]} is not a supported test type yet", :red
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
data/lib/kurgan/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kurgan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guslington
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,8 +84,9 @@ files:
|
|
84
84
|
- lib/kurgan/templates/codebuild.yaml.tt
|
85
85
|
- lib/kurgan/templates/config.yaml.tt
|
86
86
|
- lib/kurgan/templates/gitignore.tt
|
87
|
-
- lib/kurgan/templates/
|
87
|
+
- lib/kurgan/templates/test.yaml.tt
|
88
88
|
- lib/kurgan/templates/travis.yml.tt
|
89
|
+
- lib/kurgan/test.rb
|
89
90
|
- lib/kurgan/version.rb
|
90
91
|
homepage: http://iamkurgan.com
|
91
92
|
licenses:
|
@@ -107,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
108
|
- !ruby/object:Gem::Version
|
108
109
|
version: '0'
|
109
110
|
requirements: []
|
110
|
-
rubygems_version: 3.0.
|
111
|
+
rubygems_version: 3.0.3
|
111
112
|
signing_key:
|
112
113
|
specification_version: 4
|
113
114
|
summary: Manage a cfhighalnder project
|