kitchen-config 0.1.1 → 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
  SHA1:
3
- metadata.gz: 4ab2d713ae72df3a263f9e2f1ebef54ca3c4a254
4
- data.tar.gz: 8bdbec32e26e2f48eefaf493a6eb5116abb13c65
3
+ metadata.gz: a9cfc6e59a6e912fd129495bf4e10532d806cdd7
4
+ data.tar.gz: d4071361c6e90d7b7e89743220753074efeea4df
5
5
  SHA512:
6
- metadata.gz: 04995f258e0237a58654ab89b6cf01e3772a1781b0d555e1c5887f38ca909de5a1fcedafaa818a759855bca2c139d861e7b13107f69d7117b7f4385b522930f4
7
- data.tar.gz: 9f81f09933df60e06aa9889502188287ac6caee7d9bbb6039f807511db6b6b8e2749860ab0b9424ba828f36fa6c106f870f731c456dc763750f00f236349f266
6
+ metadata.gz: 7a0640250a79c77972466076d7d05a63742c632915853b4aaa919c0d511de565a1fb7dc9e5c6de25ad5ca921e666d1974ec798df647e9dda6c6fd284915b2786
7
+ data.tar.gz: 5ce8a4d7bc247258011ee387867fcd0ce8ce6648f62315438863dbfcfd228ab4ed5f648abbf7379991037873fac8f8a1a91f14878873454210e9c9996efc3f32
data/.travis.yml CHANGED
@@ -1,7 +1,15 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.0
4
- - 2.1.0
3
+ - 2.2.0
4
+ - 2.1.0
5
5
  addons:
6
- code_climate:
7
- repo_token: 51b75c40638d400d9a0a96c199f6675c3149cecf164b7922a8fa835e7c6
6
+ code_climate:
7
+ repo_token: 51b75c40638d400d9a0a96c199f6675c3149cecf164b7922a8fa835e7c6
8
+ deploy:
9
+ provider: rubygems
10
+ api_key:
11
+ secure: ZeT0xb/y1DkU/t68HCmTH0mzvMO0cE+8/UloDIEzhh+PmKX/MTtSvddBGuaTWRG7w9aTUCu1RwfQJlwvoLPcQAJLitfUL05Kc8lEnxuTTUDYrOaEMOJbKK+hzqpYJz/1xK97BN1X+GUa4YiHSJOX9xk7CHJTEZqusQ56ynOiYU5nRCJhKpY9UW4UhmSOM3y8xfRvXbKnOtGBzTKeFTfvYSOwHygk+Rp/TDwlccfXdPoh2ITP1hoQqvDR1xhtwWw+kycvy9pLOm0ccQV07mpsZ4bxhSJxnjQD8eTqOCG+9v/qzjlBRiZzwlCNS8NNGnP/0K4xMePC/WgX8UFfdBgmwTmBYZoww8XGSYMJw+bjsmAH+PxyXaTeEC/J2inFt83wtvlldgyHNwSh/BpAwdxN9WeO+K64StoBQm6bnmLYMrliKhzp6LlS00+YRFzigtjlNZMUwo/Q4fLHhBsU7OhQlEddesRHcvHiqXNSE0hl8x533hZKgtR7TzQ51XFgo6RuNKhYcQgWAtuDjNgazHdfwYjD2WqI2vqbknr73aAD3NYxfFfCKmbF1R8UDzKzZpqCmKGOYxnd+cHenOzLG6wlWUj1nsBus60H7Y9MEYaXkyRRNZKtAM8mAwhIzXfvGd8aSPvAFexPs0PkuxtURlVWcRlhX1M/Z5IuZXzVlMYXDQo=
12
+ gem: kitchen-config
13
+ on:
14
+ tags: true
15
+ repo: callmeradical/kitchen-config
data/README.md CHANGED
@@ -1,10 +1,88 @@
1
1
  [![Build Status](https://travis-ci.org/callmeradical/kitchen-config.svg?branch=master)](https://travis-ci.org/callmeradical/kitchen-config)
2
2
  [![Code Climate](https://codeclimate.com/github/callmeradical/kitchen-config/badges/gpa.svg)](https://codeclimate.com/github/callmeradical/kitchen-config)
3
3
  [![Test Coverage](https://codeclimate.com/github/callmeradical/kitchen-config/badges/coverage.svg)](https://codeclimate.com/github/callmeradical/kitchen-config/coverage)
4
- # Kitchen::Config
4
+ # Kitchen::Pantry
5
5
 
6
- Kitchen::Config handles initializing a new cookbook, and some deps.
6
+ Kitchen::Pantry handles initializing a new cookbook and provides an easy way to
7
+ configure your kitchen.yml variables across all your projects.
7
8
 
8
9
  ## Usage
9
10
 
10
- This installs initialize_cookbook, which sets up your dev env for cookbooks.
11
+ To use kitchen-config add this to your Gemfile:
12
+ ```ruby
13
+ gem 'kitchen-config'
14
+ ```
15
+
16
+ Once you have added this to your project you create a config.yml in the
17
+ location of your choice and set an environment variable called KITCHEN_PANTRY
18
+ where you'll keep it.
19
+
20
+ ```bash
21
+ $ mkdir ~/.kitchen
22
+ $ touch ~/.kitchen/config.yml
23
+ $ export KITCHEN_PANTRY=$HOME/.kitchen/config.yml
24
+ ```
25
+
26
+
27
+
28
+ Once you have created the file and set your environment variable you can start
29
+ creating keys in your config to standardize your config options.
30
+
31
+ Example config.yml
32
+
33
+
34
+ ```yaml
35
+ ---
36
+ :key_id: 'your_key_here'
37
+ :tester_ami: 'your_ami_here'
38
+ :tester_flavor_id: 'your_instance_size'
39
+ :region: 'your_region'
40
+
41
+ ```
42
+
43
+
44
+
45
+ Once your kitchen-pantry is set-up you may now include kitchen-pantry in your
46
+ .kitchen.yml file:
47
+
48
+ ```yaml
49
+ <% require 'kitchen/pantry' %>
50
+ <% config = Kitchen::Pantry %>
51
+ <% user = "#{`git config --get user.name`.chomp}" %>
52
+ ---
53
+ settings:
54
+ parallel: true
55
+
56
+ driver:
57
+ name: <%= config.driver %>
58
+ require_chef_omnibus: <%= config.chef_version %>
59
+ image_id: <%= config.amazon_ami %>
60
+ aws_ssh_key_id: <%= config.key_id %>
61
+ instance_type: '<%= config.tester_flavor_id %>'
62
+ region: '<%= config.region %>'
63
+ availability_zone: '<%= config.availability_zone %>'
64
+ subnet_id: '<%= config.subnet_id %>'
65
+ require_chef_omnibus: <%= config.chef_version %>
66
+ iam_profile_name: '<%= config.iam_profile_name%>'
67
+ <%= config.tags 'kitchen_config_test', user %>
68
+
69
+ transport:
70
+ ssh_key: <%= ENV['HOME'] %>/.ssh/<%= config.key_id %>.pem
71
+ username: '<%= config.username %>'
72
+
73
+ provisioner:
74
+ name: <%= config.provisioner %>
75
+
76
+ platforms:
77
+ - name: <%= config.default_platform %>
78
+ - name: rhel7
79
+ driver:
80
+ image_id: <%= config.rhel7_ami %>
81
+
82
+ suites:
83
+ - name: default
84
+ run_list:
85
+ - recipe[kitchen_config_test::test]
86
+ ```
87
+
88
+
@@ -0,0 +1,5 @@
1
+ ---
2
+ :key_id: 'your_key_here'
3
+ :tester_ami: 'your_ami_here'
4
+ :tester_flavor_id: 'your_instance_size'
5
+ :region: 'your_region'
@@ -1,11 +1,11 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'kitchen/config/version'
4
+ require 'kitchen/pantry/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'kitchen-config'
8
- spec.version = Kitchen::Config::VERSION
8
+ spec.version = Kitchen::Pantry::VERSION
9
9
  spec.authors = ['craig monson', 'lars cromley']
10
10
  spec.email = ['craig@malachiarts.com', 'lars@callmeradical.com']
11
11
  spec.summary = 'Basic gem for cookbook config and init.'
@@ -1,8 +1,8 @@
1
1
  # Primary module for this gem, uses method missing to read shared config file.
2
- require 'kitchen/config/version'
2
+ require 'kitchen/pantry/version'
3
3
 
4
4
  module Kitchen
5
- module Config
5
+ module Pantry
6
6
  require 'yaml'
7
7
 
8
8
  @config = nil
@@ -0,0 +1,5 @@
1
+ module Kitchen
2
+ module Pantry
3
+ VERSION = '0.2.0'
4
+ end
5
+ end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe Kitchen::Config do
3
+ RSpec.describe Kitchen::Pantry do
4
4
  context 'A Valid Kitchen Config' do
5
5
  mimic_config = {
6
6
  key_id: 'super_secret_key',
@@ -13,11 +13,11 @@ RSpec.describe Kitchen::Config do
13
13
  user = 'Derp'
14
14
  os = 'DerpOS'
15
15
 
16
- let(:subj) { Kitchen::Config }
16
+ let(:subj) { Kitchen::Pantry }
17
17
  subject { subj }
18
18
  before :each do
19
19
  config = File.expand_path(__FILE__)
20
- ENV['KITCHEN_CONFIG'] = "#{config}/config.yml"
20
+ ENV['KITCHEN_PANTRY'] = "#{config}/config.yml"
21
21
  subj.instance_variable_set('@config', mimic_config)
22
22
  end
23
23
 
@@ -29,7 +29,7 @@ RSpec.describe Kitchen::Config do
29
29
  end
30
30
 
31
31
  describe '#load_config' do
32
- let(:method) { subj.load_config(ENV['KITCHEN_CONFIG']) }
32
+ let(:method) { subj.load_config(ENV['KITCHEN_PANTRY']) }
33
33
  it { expect(subj).to respond_to(:load_config) }
34
34
  end
35
35
 
@@ -49,9 +49,9 @@ RSpec.describe Kitchen::Config do
49
49
  end
50
50
  end
51
51
 
52
- context 'An INVALID Kitchen Config' do
53
- let(:subj) { Kitchen::Config }
54
- describe 'if KITCHEN_CONFIG is not valid' do
52
+ context 'An INVALID Kitchen Pantry' do
53
+ let(:subj) { Kitchen::Pantry }
54
+ describe 'if KITCHEN_PANTRY is not valid' do
55
55
  it 'it raises an exception' do
56
56
  expect { subj.load_config(nil) }.to raise_error /ArguementError/
57
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - craig monson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-14 00:00:00.000000000 Z
12
+ date: 2016-05-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -73,15 +73,16 @@ files:
73
73
  - README.md
74
74
  - Rakefile
75
75
  - bin/initialize_cookbook
76
- - kitchen-config.gemspec
77
- - lib/kitchen/config.rb
78
- - lib/kitchen/config/version.rb
79
- - lib/kitchen/config/win32ole_chefspec_linux.rb
80
- - lib/kitchen/config/win32registry_chefspec_linux.rb
76
+ - example/config.yml
77
+ - kitchen-pantry.gemspec
78
+ - lib/kitchen/pantry.rb
79
+ - lib/kitchen/pantry/version.rb
80
+ - lib/kitchen/pantry/win32ole_chefspec_linux.rb
81
+ - lib/kitchen/pantry/win32registry_chefspec_linux.rb
81
82
  - spec/lib/kitchen/config.yml
82
- - spec/lib/kitchen/config/win32ole_chefspec_linux_spec.rb
83
- - spec/lib/kitchen/config/win32registry_chefspec_linux_spec.rb
84
- - spec/lib/kitchen/config_spec.rb
83
+ - spec/lib/kitchen/pantry/win32ole_chefspec_linux_spec.rb
84
+ - spec/lib/kitchen/pantry/win32registry_chefspec_linux_spec.rb
85
+ - spec/lib/kitchen/pantry_spec.rb
85
86
  - spec/spec_helper.rb
86
87
  - templates/.gitignore
87
88
  - templates/.kitchen.yml
@@ -123,7 +124,7 @@ specification_version: 4
123
124
  summary: Basic gem for cookbook config and init.
124
125
  test_files:
125
126
  - spec/lib/kitchen/config.yml
126
- - spec/lib/kitchen/config/win32ole_chefspec_linux_spec.rb
127
- - spec/lib/kitchen/config/win32registry_chefspec_linux_spec.rb
128
- - spec/lib/kitchen/config_spec.rb
127
+ - spec/lib/kitchen/pantry/win32ole_chefspec_linux_spec.rb
128
+ - spec/lib/kitchen/pantry/win32registry_chefspec_linux_spec.rb
129
+ - spec/lib/kitchen/pantry_spec.rb
129
130
  - spec/spec_helper.rb
@@ -1,5 +0,0 @@
1
- module Kitchen
2
- module Config
3
- VERSION = '0.1.1'
4
- end
5
- end