kitchen-bluebox 0.5.0 → 0.6.0

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/.tailor ADDED
@@ -0,0 +1,106 @@
1
+ #------------------------------------------------------------------------------
2
+ # Horizontal Whitespace
3
+ #------------------------------------------------------------------------------
4
+ # allow_hard_tabs True to let hard tabs be considered a single space.
5
+ # Default: false
6
+ #
7
+ # allow_trailing_line_spaces
8
+ # True to skip detecting extra spaces at the ends of
9
+ # lines.
10
+ # Default: false
11
+ #
12
+ # indentation_spaces The number of spaces to consider a proper indent.
13
+ # Default: 2
14
+ #
15
+ # max_line_length The maximum number of characters in a line before
16
+ # tailor complains.
17
+ # Default: 80
18
+ # spaces_after_comma Number of spaces to expect after a comma.
19
+ # Default: 1
20
+ #
21
+ # spaces_before_comma Number of spaces to expect before a comma.
22
+ # Default: 0
23
+ #
24
+ # spaces_after_lbrace The number of spaces to expect after an lbrace ('{').
25
+ # Default: 1
26
+ #
27
+ # spaces_before_lbrace The number of spaces to expect before an lbrace ('{').
28
+ # Default: 1
29
+ #
30
+ # spaces_before_rbrace The number of spaces to expect before an rbrace ('}').
31
+ # Default: 1
32
+ #
33
+ # spaces_in_empty_braces The number of spaces to expect between braces when
34
+ # there's nothing in the braces (i.e. {}).
35
+ # Default: 0
36
+ #
37
+ # spaces_after_lbracket The number of spaces to expect after an
38
+ # lbracket ('[').
39
+ # Default: 0
40
+ #
41
+ # spaces_before_rbracket The number of spaces to expect before an
42
+ # rbracket (']').
43
+ # Default: 0
44
+ #
45
+ # spaces_after_lparen The number of spaces to expect after an
46
+ # lparen ('(').
47
+ # Default: 0
48
+ #
49
+ # spaces_before_rparen The number of spaces to expect before an
50
+ # rbracket (')').
51
+ # Default: 0
52
+ #
53
+ #------------------------------------------------------------------------------
54
+ # Naming
55
+ #------------------------------------------------------------------------------
56
+ # allow_camel_case_methods
57
+ # Setting to true skips detection of camel-case method
58
+ # names (i.e. def myMethod).
59
+ # Default: false
60
+ #
61
+ # allow_screaming_snake_case_classes
62
+ # Setting to true skips detection of screaming
63
+ # snake-case class names (i.e. My_Class).
64
+ # Default: false
65
+ #
66
+ #------------------------------------------------------------------------------
67
+ # Vertical Whitespace
68
+ #------------------------------------------------------------------------------
69
+ # max_code_lines_in_class The number of lines of code in a class to allow before
70
+ # tailor will warn you.
71
+ # Default: 300
72
+ #
73
+ # max_code_lines_in_method
74
+ # The number of lines of code in a method to allow
75
+ # before tailor will warn you.
76
+ # Default: 30
77
+ #
78
+ # trailing_newlines The number of newlines that should be at the end of
79
+ # the file.
80
+ # Default: 1
81
+ #
82
+ Tailor.config do |config|
83
+ config.formatters "text"
84
+ config.file_set 'lib/**/*.rb' do |style|
85
+ style.allow_camel_case_methods false, level: :error
86
+ style.allow_hard_tabs false, level: :error
87
+ style.allow_screaming_snake_case_classes false, level: :error
88
+ style.allow_trailing_line_spaces false, level: :error
89
+ style.allow_invalid_ruby false, level: :warn
90
+ style.indentation_spaces 2, level: :error
91
+ style.max_code_lines_in_class 300, level: :error
92
+ style.max_code_lines_in_method 30, level: :error
93
+ style.max_line_length 80, level: :error
94
+ style.spaces_after_comma 1, level: :off
95
+ style.spaces_after_lbrace 1, level: :error
96
+ style.spaces_after_lbracket 0, level: :error
97
+ style.spaces_after_lparen 0, level: :error
98
+ style.spaces_before_comma 0, level: :error
99
+ style.spaces_before_lbrace 1, level: :off
100
+ style.spaces_before_rbrace 1, level: :error
101
+ style.spaces_before_rbracket 0, level: :error
102
+ style.spaces_before_rparen 0, level: :error
103
+ style.spaces_in_empty_braces 0, level: :error
104
+ style.trailing_newlines 1, level: :error
105
+ end
106
+ end
data/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ ## 0.6.0 / 2013-06-28
2
+
3
+ ### Bug fixes
4
+
5
+ * Pull request [#2][]: Don't fail to destroy if the block no longer exists. ([@sandfish8][], [@blueboxjesse][])
6
+
7
+ ### Improvements
8
+
9
+ * Write a README, damnit! ([@fnichol][])
10
+ * Remove default port config as it is the new default in core. ([@fnichol][])
11
+
12
+
13
+ <!--- The following link definition list is generated by PimpMyChangelog --->
14
+ [#2]: https://github.com/blueboxgroup/kitchen-bluebox/issues/2
15
+ [@blueboxjesse]: https://github.com/blueboxjesse
16
+ [@fnichol]: https://github.com/fnichol
17
+ [@sandfish8]: https://github.com/sandfish8
data/README.md CHANGED
@@ -1,32 +1,179 @@
1
- # Kitchen::Driver::Bluebox
1
+ # <a name="title"></a> Kitchen::Bluebox: A Test Kitchen Driver for Blue Box Blocks
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/blueboxgroup/kitchen-bluebox.png)](https://travis-ci.org/blueboxgroup/kitchen-bluebox)
4
- [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/blueboxgroup/kitchen-bluebox)
3
+ [![Gem Version](https://badge.fury.io/rb/blueboxgroup%2Fkitchen-bluebox.png)](http://badge.fury.io/rb/blueboxgroup%2Fkitchen-bluebox)
4
+ [![Build Status](https://travis-ci.org/blueboxgroup/kitchen-bluebox.png?branch=master)](https://travis-ci.org/blueboxgroup/kitchen-bluebox)
5
+ [![Code Climate](https://codeclimate.com/github/blueboxgroup/kitchen-bluebox.png)](https://codeclimate.com/github/blueboxgroup/kitchen-bluebox)
5
6
 
6
- TODO: Write a gem description
7
+ A Test Kitchen Driver for Blue Box Blocks.
7
8
 
8
- ## Installation
9
+ This driver uses the [fog gem][fog_gem] to provision and destroy blocks
10
+ instances. Use Blue Box's cloud for your infrastructure testing!
9
11
 
10
- Add this line to your application's Gemfile:
12
+ ## <a name="requirements"></a> Requirements
11
13
 
12
- gem 'kitchen-bluebox'
14
+ There are **no** external system requirements for this driver. However you
15
+ will need access to a [Blue Box][bbg_site] account.
13
16
 
14
- And then execute:
17
+ ## <a name="installation"></a> Installation and Setup
15
18
 
16
- $ bundle
19
+ Please read the [Driver usage][driver_usage] page for more details.
17
20
 
18
- Or install it yourself as:
21
+ ## <a name="config"></a> Configuration
19
22
 
20
- $ gem install kitchen-bluebox
23
+ ### <a name="config-bluebox-customer-id"></a> bluebox\_customer\_id
21
24
 
22
- ## Usage
25
+ **Required** The Blue Blue [customer id][blocks_docs] to use.
23
26
 
24
- TODO: Write usage instructions here
27
+ The default is unset, or `nil`.
25
28
 
26
- ## Contributing
29
+ ### <a name="config-bluebox-api-key"></a> bluebox\_api\_key
27
30
 
28
- 1. Fork it
31
+ **Required** The Blue Blue [api key][blocks_docs] to use.
32
+
33
+ The default is unset, or `nil`.
34
+
35
+ ### <a name="config-flavor-id"></a> flavor\_id
36
+
37
+ The blocks [product type][blocks_docs] (also known as size) to use.
38
+
39
+ The default is `"94fd37a7-2606-47f7-84d5-9000deda52ae"`.
40
+
41
+ ### <a name="config-image-id"></a> image\_id
42
+
43
+ The blocks [template id][blocks_docs] to use.
44
+
45
+ The default is `"573b8e80-823f-4100-bc2c-51b7c60f633c"`.
46
+
47
+ ### <a name="config-location-id"></a> location\_id
48
+
49
+ The blocks [location][blocks_docs] to use.
50
+
51
+ The default is `"37c2bd9a-3e81-46c9-b6e2-db44a25cc675"`.
52
+
53
+ ### <a name="config-port"></a> port
54
+
55
+ The SSH port number to be used when communicating with the instance.
56
+
57
+ The default is `22`.
58
+
59
+ ### <a name="config-require-chef-omnibus"></a> require\_chef\_omnibus
60
+
61
+ Determines whether or not a Chef [Omnibus package][chef_omnibus_dl] will be
62
+ installed. There are several different behaviors available:
63
+
64
+ * `true` - the latest release will be installed. Subsequent converges
65
+ will skip re-installing if chef is present.
66
+ * `latest` - the latest release will be installed. Subsequent converges
67
+ will always re-install even if chef is present.
68
+ * `<VERSION_STRING>` (ex: `10.24.0`) - the desired version string will
69
+ be passed the the install.sh script. Subsequent converges will skip if
70
+ the installed version and the desired version match.
71
+ * `false` or `nil` - no chef is installed.
72
+
73
+ The default value is unset, or `nil`.
74
+
75
+ ### <a name="config-ssh-key"></a> ssh\_key
76
+
77
+ Path to the private SSH key used to connect to the instance.
78
+
79
+ The default is unset, or `nil`.
80
+
81
+ ### <a name="config-sudo"></a> sudo
82
+
83
+ Whether or not to prefix remote system commands such as installing and
84
+ running Chef with `sudo`.
85
+
86
+ The default is `true`.
87
+
88
+ ### <a name="config-username"></a> username
89
+
90
+ The SSH username that will be used to communicate with the instance.
91
+
92
+ The default is `"kitchen"`.
93
+
94
+ ## <a name="example"></a> Example
95
+
96
+ The following could be used in a `.kitchen.yml` or in a `.kitchen.local.yml`
97
+ to override default configuration.
98
+
99
+ ```yaml
100
+ ---
101
+ driver_plugin: bluebox
102
+ driver_config:
103
+ bluebox_customer_id: 123...
104
+ bluebox_api_key: abc...
105
+ location_id: def789...
106
+ ssh_public_key: /path/to/id_dsa.pub
107
+ ssh_key: /path/to/id_dsa
108
+ require_chef_omnibus: true
109
+
110
+ platforms:
111
+ - name: ubuntu-12.04
112
+ driver_config:
113
+ image_id: b137c423-bade-4b01-9d13-271eea552563
114
+ - name: scientific-6.3
115
+ driver_config:
116
+ image_id: caaaca6b-fbe0-4e27-af2b-d100e46767bd
117
+
118
+ suites:
119
+ # ...
120
+ ```
121
+
122
+ Both `.kitchen.yml` and `.kitchen.local.yml` files are pre-processed through
123
+ ERB which can help to factor out secrets and credentials. For example:
124
+
125
+ ```yaml
126
+ ---
127
+ driver_plugin: bluebox
128
+ driver_config:
129
+ bluebox_customer_id: <%= ENV['BLUEBOX_CUSTOMER_ID'] %>
130
+ bluebox_api_key: <%= ENV['BLUEBOX_API_KEY'] %>
131
+ ssh_public_key: <%= File.expand_path('~/.ssh/id_dsa.pub') %>
132
+ ssh_key: <%= File.expand_path('~/.ssh/id_dsa') %>
133
+ require_chef_omnibus: true
134
+
135
+ platforms:
136
+ - name: ubuntu-12.04
137
+ driver_config:
138
+ image_id: b137c423-bade-4b01-9d13-271eea552563
139
+ - name: scientific-6.3
140
+ driver_config:
141
+ image_id: caaaca6b-fbe0-4e27-af2b-d100e46767bd
142
+
143
+ suites:
144
+ # ...
145
+ ```
146
+
147
+ ## <a name="development"></a> Development
148
+
149
+ * Source hosted at [GitHub][repo]
150
+ * Report issues/questions/feature requests on [GitHub Issues][issues]
151
+
152
+ Pull requests are very welcome! Make sure your patches are well tested.
153
+ Ideally create a topic branch for every separate change you make. For
154
+ example:
155
+
156
+ 1. Fork the repo
29
157
  2. Create your feature branch (`git checkout -b my-new-feature`)
30
- 3. Commit your changes (`git commit -am 'Add some feature'`)
158
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
31
159
  4. Push to the branch (`git push origin my-new-feature`)
32
160
  5. Create new Pull Request
161
+
162
+ ## <a name="authors"></a> Authors
163
+
164
+ Created and maintained by [Fletcher Nichol][author] (<fnichol@nichol.ca>)
165
+
166
+ ## <a name="license"></a> License
167
+
168
+ Apache 2.0 (see [LICENSE][license])
169
+
170
+
171
+ [author]: https://github.com/fnichol
172
+ [issues]: https://github.com/blueboxgroup/kitchen-bluebox/issues
173
+ [license]: https://github.com/blueboxgroup/kitchen-bluebox/blob/master/LICENSE
174
+ [repo]: https://github.com/blueboxgroup/kitchen-bluebox
175
+ [driver_usage]: http://docs.kitchen-ci.org/drivers/usage
176
+ [chef_omnibus_dl]: http://www.opscode.com/chef/install/
177
+
178
+ [bbg_site]: https://bluebox.net/
179
+ [blocks_docs]: https://boxpanel.bluebox.net/public/the_vault/index.php/Blocks_API
data/Rakefile CHANGED
@@ -3,7 +3,9 @@ require 'cane/rake_task'
3
3
  require 'tailor/rake_task'
4
4
 
5
5
  desc "Run cane to check quality metrics"
6
- Cane::RakeTask.new
6
+ Cane::RakeTask.new do |cane|
7
+ cane.canefile = './.cane'
8
+ end
7
9
 
8
10
  Tailor::RakeTask.new
9
11
 
@@ -13,4 +15,7 @@ task :stats do
13
15
  sh "countloc -r lib/kitchen"
14
16
  end
15
17
 
16
- task :default => [ :cane, :tailor, :stats ]
18
+ desc "Run all quality tasks"
19
+ task :quality => [:cane, :tailor, :stats]
20
+
21
+ task :default => [:quality]
@@ -34,7 +34,6 @@ module Kitchen
34
34
  default_config :image_id, '573b8e80-823f-4100-bc2c-51b7c60f633c'
35
35
  default_config :location_id, '37c2bd9a-3e81-46c9-b6e2-db44a25cc675'
36
36
  default_config :username, 'kitchen'
37
- default_config :port, '22'
38
37
 
39
38
  required_config :bluebox_customer_id
40
39
  required_config :bluebox_api_key
@@ -55,9 +54,9 @@ module Kitchen
55
54
  return if state[:block_id].nil?
56
55
 
57
56
  connection.destroy_block(state[:block_id])
58
- info("Blocks instance <#{state[:block_id]}> destroyed.")
59
- state.delete(:block_id)
60
- state.delete(:hostname)
57
+ update_state_for_destroy(state)
58
+ rescue Fog::Compute::Bluebox::NotFound
59
+ update_state_for_destroy(state)
61
60
  rescue Fog::Errors::Error, Excon::Errors::Error => ex
62
61
  raise ActionFailed, ex.message
63
62
  end
@@ -89,6 +88,12 @@ module Kitchen
89
88
 
90
89
  connection.servers.create(opts)
91
90
  end
91
+
92
+ def update_state_for_destroy(state)
93
+ info("Blocks instance <#{state[:block_id]}> destroyed.")
94
+ state.delete(:block_id)
95
+ state.delete(:hostname)
96
+ end
92
97
  end
93
98
  end
94
99
  end
@@ -20,6 +20,6 @@ module Kitchen
20
20
 
21
21
  module Driver
22
22
 
23
- BLUEBOX_VERSION = "0.5.0"
23
+ BLUEBOX_VERSION = "0.6.0"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-bluebox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
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-03-02 00:00:00.000000000 Z
12
+ date: 2013-06-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-kitchen
@@ -131,7 +131,9 @@ extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
133
  - .gitignore
134
+ - .tailor
134
135
  - .travis.yml
136
+ - CHANGELOG.md
135
137
  - Gemfile
136
138
  - LICENSE
137
139
  - README.md
@@ -151,18 +153,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
153
  - - ! '>='
152
154
  - !ruby/object:Gem::Version
153
155
  version: '0'
154
- segments:
155
- - 0
156
- hash: -2100783807985549325
157
156
  required_rubygems_version: !ruby/object:Gem::Requirement
158
157
  none: false
159
158
  requirements:
160
159
  - - ! '>='
161
160
  - !ruby/object:Gem::Version
162
161
  version: '0'
163
- segments:
164
- - 0
165
- hash: -2100783807985549325
166
162
  requirements: []
167
163
  rubyforge_project:
168
164
  rubygems_version: 1.8.24