kitchen-nodes 0.1.0.dev

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: df1c8dede4f01d42226a9fbfbc0f32d4fe97ca37
4
+ data.tar.gz: 00ecf4c1ec8cbad7c709636ff31463f456cf08d6
5
+ SHA512:
6
+ metadata.gz: bdd211c9b78b8b67834191f2634c9903a54f40f8889df6014a620be48efb590d68d92382c9726c9b8ff7bb96bba46026f1c2274c5692bc007ffff80d861e359b
7
+ data.tar.gz: 4a5fa19be79e810f21caf38276ed929c2bebd83fa6a66126bb4862743ee2b3031e18923f79f66b85f5e946bf76507ad519780b6f760a653504b2a075e516f7c9
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 2.0.0
5
+ - 1.9.3
6
+ - 1.9.2
7
+ - ruby-head
8
+
9
+ matrix:
10
+ allow_failures:
11
+ - rvm: ruby-head
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## 0.1.0 / Unreleased
2
+
3
+ * Initial release
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ Author:: Matt Wrock (<matt@mattwrock.com>)
2
+
3
+ Copyright (C) 2015, Matt Wrock
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # <a name="title"></a> Kitchen::Nodes
2
+
3
+ A Test Kitchen Provisioner that generates searchable Nodes.
4
+
5
+ ## <a name="installation"></a> Installation and Setup
6
+
7
+ Please read the [Driver usage][driver_usage] page for more details.
8
+
9
+ ## <a name="config"></a> Configuration
10
+
11
+ ```
12
+ provisioner:
13
+ name: nodes
14
+ ```
15
+
16
+ The nodes provisioner extends the `chef-zero` provisioner along with all of its functionality and configuration.
17
+
18
+ ## <a name="development"></a> Development
19
+
20
+ * Source hosted at [GitHub][repo]
21
+ * Report issues/questions/feature requests on [GitHub Issues][issues]
22
+
23
+ Pull requests are very welcome! Make sure your patches are well tested.
24
+ Ideally create a topic branch for every separate change you make. For
25
+ example:
26
+
27
+ 1. Fork the repo
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create new Pull Request
32
+
33
+ ## <a name="authors"></a> Authors
34
+
35
+ Created and maintained by [Matt Wrock][author] (<matt@mattwrock.com>)
36
+
37
+ ## <a name="license"></a> License
38
+
39
+ Apache 2.0 (see [LICENSE][license])
40
+
41
+
42
+ [author]: https://github.com/enter-github-user
43
+ [issues]: https://github.com/enter-github-user/kitchen-nodes/issues
44
+ [license]: https://github.com/enter-github-user/kitchen-nodes/blob/master/LICENSE
45
+ [repo]: https://github.com/enter-github-user/kitchen-nodes
46
+ [driver_usage]: http://docs.kitchen-ci.org/drivers/usage
47
+ [chef_omnibus_dl]: http://www.getchef.com/chef/install/
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:test)
5
+
6
+ task :default => [:test]
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'kitchen/provisioner/nodes_version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'kitchen-nodes'
8
+ spec.version = Kitchen::Provisioner::NODES_VERSION
9
+ spec.authors = ['Matt Wrock']
10
+ spec.email = ['matt@mattwrock.com']
11
+ spec.description = %q{A Test Kitchen Provisioner for Chef Nodes}
12
+ spec.summary = spec.description
13
+ spec.homepage = ''
14
+ spec.license = 'Apache 2.0'
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = []
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.3'
22
+ spec.add_development_dependency 'rake'
23
+ end
@@ -0,0 +1,57 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ # Author:: Matt Wrock (<matt@mattwrock.com>)
4
+ #
5
+ # Copyright (C) 2015, Matt Wrock
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ require "kitchen"
20
+ require "kitchen/provisioner/chef_zero"
21
+
22
+ module Kitchen
23
+
24
+ module Provisioner
25
+
26
+ # Nodes provisioner for Kitchen.
27
+ #
28
+ # @author Matt Wrock <matt@mattwrock.com>
29
+ class Nodes < ChefZero
30
+
31
+ def create_sandbox
32
+ super
33
+ create_node
34
+ end
35
+
36
+ def create_node
37
+ node_dir = File.join(config[:test_base_path], "nodes")
38
+ Dir.mkdir(node_dir) unless Dir.exist?(node_dir)
39
+ node_file = File.join(node_dir, "#{instance.name}.json")
40
+
41
+ state = Kitchen::StateFile.new(config[:kitchen_root], instance.name).read
42
+
43
+ node = {
44
+ :id => instance.name,
45
+ :automatic => {
46
+ :ipaddress => state[:hostname]
47
+ },
48
+ :run_list => config[:run_list]
49
+ }
50
+
51
+ File.open(node_file, 'w') do |out|
52
+ out << JSON.pretty_generate(node)
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ # Author:: Matt Wrock (<matt@mattwrock.com>)
4
+ #
5
+ # Copyright (C) 2015, Matt Wrock
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ module Kitchen
20
+
21
+ module Provisioner
22
+
23
+ # Version string for Nodes Kitchen driver
24
+ NODES_VERSION = "0.1.0.dev"
25
+ end
26
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kitchen-nodes
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0.dev
5
+ platform: ruby
6
+ authors:
7
+ - Matt Wrock
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: A Test Kitchen Provisioner for Chef Nodes
42
+ email:
43
+ - matt@mattwrock.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - .travis.yml
50
+ - CHANGELOG.md
51
+ - Gemfile
52
+ - LICENSE
53
+ - README.md
54
+ - Rakefile
55
+ - kitchen-nodes.gemspec
56
+ - lib/kitchen/provisioner/nodes.rb
57
+ - lib/kitchen/provisioner/nodes_version.rb
58
+ homepage: ''
59
+ licenses:
60
+ - Apache 2.0
61
+ metadata: {}
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>'
74
+ - !ruby/object:Gem::Version
75
+ version: 1.3.1
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.4.4
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: A Test Kitchen Provisioner for Chef Nodes
82
+ test_files: []
83
+ has_rdoc: