daptiv-chef-ci 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,2 +1,74 @@
1
1
  # Daptiv Chef CI
2
- Common tools to help automate Vagrant in CI
2
+ Common tools to help automate Vagrant in CI
3
+
4
+ This is a really thin wrapper around Vagrant that makes it a little easier to call Vagrant from a Rake build. Why on earth does this exist?
5
+
6
+ 1. Makes it easier to call your installed Vagrant from a Rake build.
7
+ 2. Ensures vagrant is loaded from your PATH and _not_ from a bundled gem.
8
+ 3. Reduces duplication between cookbook Vagrantfiles.
9
+
10
+ ## Basic Usage
11
+
12
+ Add a dependency for daptiv-chef-ci in your Gemfile
13
+
14
+ `gem 'daptiv-chef-ci'`
15
+
16
+ In your Rakefile require 'daptiv-chef-ci/vagrant_task' and then declare a new Vagrant::RakeTask. The minimal task declaration look like this in your rake file:
17
+
18
+ ```
19
+ require 'daptiv-chef-ci/vagrant_task'
20
+
21
+ Vagrant::RakeTask.new
22
+ ```
23
+
24
+ The rake task will attempt to load a Vagrantfile as an Erubis template from the following locations in order:
25
+
26
+ - Vagrantfile.erb
27
+ - Vagrantfile
28
+
29
+ If none of those exist the task will use the Vagrantfile.erb template embedded in this gem. Here's an example that specifies a Windows Vagrant box using the embedded Vagrantfile:
30
+
31
+ ```
32
+ require 'daptiv-chef-ci/vagrant_task'
33
+
34
+ Vagrant::RakeTask.new do |task|
35
+ task.guest_os = :windows
36
+ task.box_name = 'vagrant-windows2008r2'
37
+ task.box_url = 'http://example.com/vagrant/boxes/vagrant-windows2008r2.box'
38
+ task.run_list = ['mycookbook::recipe']
39
+ end
40
+ ```
41
+
42
+ ## Configuration
43
+
44
+ The vagrant rake task provides the following configuration parameters to the ERB template, these can be configured using the same name in the rake task:
45
+
46
+ - guest_os - defaults to :linux
47
+ - chef_repo_dir - The chef-repo root directory, defaults to ~/src/chef-repo
48
+ - box_name - defaults to 'Vagrant-hostname', this is optional.
49
+ - node_name - The chef node name, defaults to 'Vagrant-hostname', this is optional.
50
+ - box_url - URL to the box download location, this is optional.
51
+ - run_list - The Chef run list, defaults to empty.
52
+ - chef_json - Any additional Chef attributes in json format, this is optional.
53
+
54
+ ## Logging
55
+
56
+ By default this gem will not log anything other than errors to stderr, however quite often its useful to get more information from the running Vagrant process. To change the gem logging level set the CHEF_CI_LOG environment variable to one supported by log4r (DEBUG, INFO etc).
57
+
58
+ `CHEF_CI_LOG=DEBUG bundle exec rake vagrant`
59
+
60
+ ## Development
61
+
62
+ Clone this repository and use [Bundler](http://gembundler.com) to get the dependencies:
63
+
64
+ ```
65
+ $ bundle install
66
+ ```
67
+
68
+ Once you have the dependencies, you can run the unit tests with `rake`:
69
+
70
+ ```
71
+ $ bundle exec rake
72
+ ```
73
+
74
+ If those pass, you're ready to start developing.
@@ -43,7 +43,7 @@ Gem::Specification.new do |gem|
43
43
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
44
44
  gem.name = "daptiv-chef-ci"
45
45
  gem.require_paths = ["lib"]
46
- gem.version = '0.0.2'
46
+ gem.version = '0.0.3'
47
47
 
48
48
  gem.add_runtime_dependency "log4r", "~> 1.1.10"
49
49
  gem.add_runtime_dependency "erubis", "~> 2.7.0"
@@ -75,7 +75,7 @@ module DaptivChefCI
75
75
  def vagrantfile_erb_path()
76
76
  erbs = [
77
77
  File.join(Dir.pwd, 'Vagrantfile.erb'),
78
- File.join(Dir.pwd, 'build/Vagrantfile.erb'),
78
+ File.join(Dir.pwd, 'Vagrantfile'),
79
79
  File.expand_path('Vagrantfile.erb', template_dir())
80
80
  ]
81
81
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daptiv-chef-ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-21 00:00:00.000000000 Z
12
+ date: 2013-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: log4r
@@ -155,6 +155,7 @@ files:
155
155
  - lib/daptiv-chef-ci/vagrant_task.rb
156
156
  - lib/daptiv-chef-ci/virtualbox_driver.rb
157
157
  - pkg/daptiv-chef-ci-0.0.1.gem
158
+ - pkg/daptiv-chef-ci-0.0.2.gem
158
159
  - Rakefile
159
160
  - README.md
160
161
  - spec/daptiv-chef-ci/logger_spec.rb
@@ -176,7 +177,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
177
  version: '0'
177
178
  segments:
178
179
  - 0
179
- hash: 4054523152621213775
180
+ hash: -504818496541812232
180
181
  required_rubygems_version: !ruby/object:Gem::Requirement
181
182
  none: false
182
183
  requirements:
@@ -185,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
186
  version: '0'
186
187
  segments:
187
188
  - 0
188
- hash: 4054523152621213775
189
+ hash: -504818496541812232
189
190
  requirements: []
190
191
  rubyforge_project:
191
192
  rubygems_version: 1.8.23