kitchen-local 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Ian N Schenck
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1 @@
1
+ # kitchen-local
@@ -0,0 +1,29 @@
1
+ # encoding: utf-8
2
+
3
+ $:.unshift File.expand_path('../lib', __FILE__)
4
+ require 'kitchen/local/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "kitchen-local"
8
+ s.version = Kitchen::Local::VERSION
9
+ s.authors = ["Ian Schenck"]
10
+ s.email = ["ian.schenck@gmail.com"]
11
+ s.homepage = "https://github.com/ianschenck/kitchen-local"
12
+ s.summary = "driver for test-kitchen for running on the local machine"
13
+ candidates = Dir.glob("{lib}/**/*") + ['README.md', 'LICENSE.txt', 'kitchen-local.gemspec']
14
+ s.files = candidates.sort
15
+ s.platform = Gem::Platform::RUBY
16
+ s.require_paths = ['lib']
17
+ s.rubyforge_project = '[none]'
18
+ s.description = <<-EOF
19
+ == DESCRIPTION:
20
+
21
+ local driver for test-kitchen for running directly against the current, local machine
22
+
23
+ == FEATURES:
24
+
25
+ ssh driver for test-kitchen for any running server with an ip address
26
+
27
+ EOF
28
+
29
+ end
@@ -0,0 +1,62 @@
1
+ require 'fileutils'
2
+
3
+ require 'kitchen'
4
+ require 'kitchen/driver/base'
5
+
6
+ module Kitchen
7
+ module Driver
8
+ class Local < Base
9
+
10
+ def create(state) ; end
11
+
12
+ def converge(state)
13
+ provisioner = instance.provisioner
14
+ provisioner.create_sandbox
15
+ sandbox_dirs = Dir.glob("#{provisioner.sandbox_path}/*")
16
+
17
+ run(provisioner.install_command)
18
+ run(provisioner.init_command)
19
+ transfer_path(sandbox_dirs, provisioner[:root_path])
20
+ provisioner.prepare_command && run(provisioner.prepare_command)
21
+ provisioner.run_command && run(provisioner.run_command)
22
+ ensure
23
+ provisioner && provisioner.cleanup_sandbox
24
+ end
25
+
26
+ def setup(state)
27
+ busser_setup_cmd && run(busser_setup_cmd)
28
+ end
29
+
30
+ def verify(state)
31
+ busser_sync_cmd && run(busser_sync_cmd)
32
+ busser_run_cmd && run(busser_run_cmd)
33
+ end
34
+
35
+ def destroy(state) ; end
36
+
37
+ def ssh(ssh_args, command)
38
+ command && run(command)
39
+ end
40
+
41
+ protected
42
+
43
+ def run(command)
44
+ system({
45
+ "GEM_PATH" => nil,
46
+ "GEM_HOME" => nil,
47
+ "BUNDLE_BIN_PATH" => nil,
48
+ "BUNDLE_GEMFILE" => nil,
49
+ "RUBYOPT" => nil,
50
+ "RUBYLIB" => nil
51
+ },command)
52
+ end
53
+
54
+ def transfer_path(locals, remote)
55
+ return if locals.nil? || Array(locals).empty?
56
+ locals.each { |local| `cp -r #{local} #{remote}` }
57
+ end
58
+
59
+ end
60
+ end
61
+ end
62
+
@@ -0,0 +1,5 @@
1
+ module Kitchen
2
+ module Local
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kitchen-local
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Ian Schenck
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-06-20 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: ! '== DESCRIPTION:
15
+
16
+
17
+ local driver for test-kitchen for running directly against the current, local machine
18
+
19
+
20
+ == FEATURES:
21
+
22
+
23
+ ssh driver for test-kitchen for any running server with an ip address
24
+
25
+
26
+ '
27
+ email:
28
+ - ian.schenck@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - LICENSE.txt
34
+ - README.md
35
+ - kitchen-local.gemspec
36
+ - lib/kitchen/driver/local.rb
37
+ - lib/kitchen/local/version.rb
38
+ homepage: https://github.com/ianschenck/kitchen-local
39
+ licenses: []
40
+ post_install_message:
41
+ rdoc_options: []
42
+ require_paths:
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ none: false
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubyforge_project: ! '[none]'
58
+ rubygems_version: 1.8.11
59
+ signing_key:
60
+ specification_version: 3
61
+ summary: driver for test-kitchen for running on the local machine
62
+ test_files: []