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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13e0829241c7cb5e338bf5bcd9f0e2dda93c762f3892866cc6af12663fb50a28
4
- data.tar.gz: 227a2567eae45d9385aa385b634cb0089f04d47b7962150ec8bffa342209674b
3
+ metadata.gz: 85a9e2245bfe3886184f93bae66f16c5f8b565354ada5319f9ce5e0c40fd9775
4
+ data.tar.gz: 5e8ae3b2bd577f44ee6c0f11999a67dbb3674a3f07c4d52c7f88a1f50bd08fae
5
5
  SHA512:
6
- metadata.gz: d1db730b78f85a5b800f9d6b493a80c6bff0c85dc691f7a15775896570b3304ef01083771b28995a66aa455d57759d2afcc23b6e661e7dcf7b5e4068237097df
7
- data.tar.gz: eafc409b22f9b9397181ca69f0181c4d6bdac21923ea1dd7ae9da1c64c806e66f7b7e1fc1c42d577e87a798ea3a91f2286735e1deab8e373620d996cdacf6c45
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.1.4)
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 (~> 1.16)
17
+ bundler (~> 2.0)
18
18
  kurgan!
19
19
  rake (~> 10.0)
20
20
 
21
21
  BUNDLED WITH
22
- 1.16.1
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.org/theonestack/kurgan.svg?branch=develop)](https://travis-ci.org/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)
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
@@ -32,6 +32,6 @@ Gem::Specification.new do |spec|
32
32
 
33
33
  spec.add_dependency "thor", "~> 0.19"
34
34
 
35
- spec.add_development_dependency "bundler", "~> 1.16"
35
+ spec.add_development_dependency "bundler", "~> 2.0"
36
36
  spec.add_development_dependency "rake", "~> 10.0"
37
37
  end
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 :template
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] || template
18
+ @name = options[:name] || component
19
19
  end
20
20
 
21
21
  def get_template_version
22
- @template = options[:version] ? "#{template}@#{options[:version]}" : template
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
 
@@ -27,13 +27,9 @@ module Kurgan
27
27
  template('templates/cfndsl.rb.tt', "#{@dir}/#{name}.cfndsl.rb")
28
28
  end
29
29
 
30
- def create_empty_test
31
- if yes?("Setup sample test?")
32
- empty_directory "#{@dir}/tests"
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
@@ -0,0 +1,6 @@
1
+ test_metadata:
2
+ type: config
3
+ name: <%= @test_name %>
4
+ description: set the description for your test
5
+
6
+ # Insert your tests here
@@ -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
- - gem install cfhighlander
14
+ - cfcompile
15
15
  <%- end -%>
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Kurgan
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.4
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-02-19 00:00:00.000000000 Z
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: '1.16'
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: '1.16'
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/sns_topic.test.yaml.tt
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.2
111
+ rubygems_version: 3.0.3
111
112
  signing_key:
112
113
  specification_version: 4
113
114
  summary: Manage a cfhighalnder project
@@ -1,6 +0,0 @@
1
- test_metadata:
2
- type: config
3
- name: sns_topic
4
- description: test for the default sns topic
5
-
6
- topic_name: sample-test