kitchen-inspector 1.0.1 → 1.1.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.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.travis.yml +9 -0
- data/CHANGELOG.md +24 -0
- data/Gemfile +0 -2
- data/README.md +268 -39
- data/Rakefile +41 -0
- data/kitchen-inspector.gemspec +21 -3
- data/lib/kitchen-inspector/inspector.rb +11 -4
- data/lib/kitchen-inspector/inspector/chef_inspector.rb +66 -0
- data/lib/kitchen-inspector/inspector/cli.rb +29 -3
- data/lib/kitchen-inspector/inspector/{error.rb → common.rb} +43 -1
- data/lib/kitchen-inspector/inspector/dependency.rb +26 -40
- data/lib/kitchen-inspector/inspector/health_bureau.rb +181 -0
- data/lib/kitchen-inspector/inspector/mixin/utils.rb +83 -0
- data/lib/kitchen-inspector/inspector/report/report.rb +182 -0
- data/lib/kitchen-inspector/inspector/report/status_reporter.rb +105 -0
- data/lib/kitchen-inspector/inspector/repository_inspector.rb +134 -0
- data/lib/kitchen-inspector/inspector/repository_managers/base.rb +110 -0
- data/lib/kitchen-inspector/inspector/repository_managers/github.rb +97 -0
- data/lib/kitchen-inspector/inspector/repository_managers/gitlab.rb +100 -0
- data/lib/kitchen-inspector/inspector/version.rb +1 -2
- data/spec/cli_spec.rb +46 -0
- data/spec/data/cookbook_deps/metadata.rb +10 -0
- data/spec/data/cookbook_no_deps/metadata.rb +7 -0
- data/spec/data/test_client.pem +27 -0
- data/spec/data/test_config_invalid.rb +4 -0
- data/spec/data/test_config_valid.rb +4 -0
- data/spec/dependency_inspector_spec.rb +296 -0
- data/spec/github_manager_spec.rb +79 -0
- data/spec/gitlab_manager_spec.rb +58 -0
- data/spec/report_spec.rb +237 -0
- data/spec/support/spec_helper.rb +81 -0
- data/spec/utils_spec.rb +29 -0
- metadata +129 -15
- data/INFO.md +0 -44
- data/info.css +0 -31
- data/lib/kitchen-inspector/inspector/dependency_inspector.rb +0 -153
- data/lib/kitchen-inspector/inspector/report.rb +0 -148
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4146d1e7d37eab22555d357517ac7a44a43f1213
|
|
4
|
+
data.tar.gz: e9ac2ee18b946515038713a5261265280856e52d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 20e92986432fb382af3db7928902cfca6c0337911ed395d3bcc6310ca51ef2169038255a8b7163162a1fb98c3c4eb1783728ffa78ec7dad3a60f7d91be2fec29
|
|
7
|
+
data.tar.gz: 0415842acfdb0e434d6e8c019de5a3bd45d24c3bcf2fbc860956c358a0ff474ef9f67e48e00c7307b7b430cffbe6478719e05e3689a8a89af1d53bfb7b03b0cd
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
language: ruby
|
|
2
|
+
rvm:
|
|
3
|
+
- 2.0.0
|
|
4
|
+
- 1.9.3
|
|
5
|
+
- 1.9.2
|
|
6
|
+
script: bundle exec rspec spec
|
|
7
|
+
env:
|
|
8
|
+
global:
|
|
9
|
+
secure: ox+FSwU2Ue7t3Yq/XKiUvvY5kZ6H2BTAza3zQdHgKq3hhqF9xowp1QSB2BybVSreVgy+dMPivsk5ZPX67aZwfH0tYOJRkaZODVYTxbu/gygTAkcpf9qqGTsS9ISXn6EGqXfAWHXAPsuhjDbMgGBbuAxj0k/HagDSrd7mKvqsrgc=
|
data/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,40 @@
|
|
|
1
1
|
Changes
|
|
2
2
|
==
|
|
3
|
+
17 Dec 2013 (1.1.0)
|
|
4
|
+
--
|
|
5
|
+
|
|
6
|
+
FEATURES:
|
|
7
|
+
|
|
8
|
+
* Add option to recursively analyze cookbook's dependencies (defaults to true)
|
|
9
|
+
* Use a file to store configuration info (defaults to *${HOME}/.chef/kitchen_inspector.rb*)
|
|
10
|
+
* Add option to show remarks (*--remarks*), that now are hidden by default
|
|
11
|
+
* Add support for different Repository Managers (GitLab and GitHub)
|
|
12
|
+
* Verify that a tag on the Repository Manager matches the corresponding metadata's version
|
|
13
|
+
* Add exit codes to integrate Kitchen Inspector with a CI process
|
|
14
|
+
* Handle not unique projects on Repository Manager
|
|
15
|
+
* Analyze transitive dependencies even when Chef's version is null
|
|
16
|
+
* Show url to Repository Manager's diff whenever possible
|
|
17
|
+
|
|
18
|
+
FIXES:
|
|
19
|
+
|
|
20
|
+
* Handle case in which a given cookbook doesn't exist on both servers
|
|
21
|
+
* Grab information from Chef Server even when it's missing on the Repository Manager
|
|
22
|
+
* Discard tags that are not versions (e.g., 'qa-latest')
|
|
23
|
+
|
|
3
24
|
18 Nov 2013 (1.0.1)
|
|
4
25
|
--
|
|
5
26
|
|
|
6
27
|
FIXES:
|
|
28
|
+
|
|
7
29
|
* Fix warnings retrieval and priorities
|
|
8
30
|
|
|
9
31
|
CHANGES:
|
|
32
|
+
|
|
10
33
|
* Add alias 'inspect'
|
|
11
34
|
|
|
12
35
|
15 Nov 2013 (1.0.0)
|
|
13
36
|
--
|
|
14
37
|
|
|
15
38
|
FEATURES:
|
|
39
|
+
|
|
16
40
|
* First release
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -1,55 +1,78 @@
|
|
|
1
1
|
# Kitchen Inspector
|
|
2
|
+
[](https://travis-ci.org/astratto/kitchen-inspector)
|
|
3
|
+
[](https://gemnasium.com/astratto/kitchen-inspector)
|
|
4
|
+
[](http://badge.fury.io/rb/kitchen-inspector)
|
|
5
|
+
[](https://codeclimate.com/github/astratto/kitchen-inspector)
|
|
6
|
+
[](https://coveralls.io/r/astratto/kitchen-inspector)
|
|
2
7
|
|
|
3
|
-
Kitchen
|
|
8
|
+
Kitchen Inspector is a CLI utility to check a cookbook's dependency status using a Chef server and a Repository Manager.
|
|
9
|
+
|
|
10
|
+
In particular, this tool checks whether the dependencies specified in a cookbook's metadata are up to date or not.
|
|
11
|
+
It also shows whether one of the servers must be aligned.
|
|
12
|
+
|
|
13
|
+
By default, dependencies are recursively analyzed and transitive dependencies are shown indented.
|
|
4
14
|
|
|
5
15
|
It assumes that your kitchen is composed by:
|
|
6
16
|
|
|
7
17
|
* a Chef server containing the cookbooks to be used
|
|
8
|
-
* a
|
|
18
|
+
* a Repository Manager hosting cookbook's development
|
|
9
19
|
|
|
10
|
-
|
|
11
|
-
It also shows whether one of the servers must be aligned.
|
|
20
|
+
**Note:** at this stage GitLab and GitHub are supported.
|
|
12
21
|
|
|
13
22
|
## Installation
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+
Install it from RubyGems.org with:
|
|
16
25
|
|
|
17
|
-
|
|
26
|
+
```bash
|
|
27
|
+
$ gem install kitchen-inspector
|
|
28
|
+
```
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
Or with Rake:
|
|
20
31
|
|
|
21
|
-
|
|
32
|
+
```bash
|
|
33
|
+
[kitchen-inspector_clone_dir]$ rake install
|
|
34
|
+
```
|
|
22
35
|
|
|
23
|
-
|
|
36
|
+
Repository Managers are loaded dynamically, so you should also install specific gems.
|
|
24
37
|
|
|
25
|
-
|
|
38
|
+
If you plan to use Kitchen Inspector with:
|
|
26
39
|
|
|
27
|
-
|
|
40
|
+
* GitHub: ```gem install octokit```
|
|
41
|
+
* GitLab: ```gem install gitlab```
|
|
28
42
|
|
|
29
|
-
|
|
43
|
+
## Usage
|
|
30
44
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* CHEF_SERVER_URL: Url of the Chef server
|
|
34
|
-
* CHEF_USERNAME: Client username
|
|
35
|
-
* CHEF_CLIENT_PEM: Location of the client pem
|
|
45
|
+
A valid configuration must be provided in order to configure the Chef Server and the Repository Manager.
|
|
46
|
+
See [Configuration](#configuration) for details.
|
|
36
47
|
|
|
37
48
|
From inside the cookbook's directory, type `kitchen-inspector` to inspect your kitchen.
|
|
38
|
-
It's also possible to specify a target directory with `kitchen-inspector
|
|
49
|
+
It's also possible to specify a target directory with `kitchen-inspector inspect PATH`.
|
|
50
|
+
|
|
51
|
+
Cookbook's `metadata.rb` is parsed to obtain the dependencies, then the configured Chef server and Repository Manager are queried to define which versions are available.
|
|
52
|
+
**Note:** The Chef server's version is the one that defines the used version.
|
|
39
53
|
|
|
40
|
-
|
|
41
|
-
The Chef server's version is the one that will define the used version.
|
|
54
|
+
When a usable version is not found, Repository Manager's latest tag is used to analyze transitive dependencies.
|
|
42
55
|
|
|
43
56
|
It will display a table that contains the following rows:
|
|
44
57
|
|
|
45
58
|
* `Name` - The name of the cookbook
|
|
46
59
|
* `Requirement` - The version requirement specified in the metadata
|
|
47
60
|
* `Used` - The final version used based on the requirement constraint
|
|
48
|
-
* `Latest
|
|
49
|
-
* `Latest
|
|
50
|
-
* `Requirement Status` - The status of the cookbook:
|
|
51
|
-
*
|
|
52
|
-
*
|
|
61
|
+
* `Chef Latest` - The latest version available on the Chef server
|
|
62
|
+
* `Repository Latest` - The latest version available on the Repository Manager
|
|
63
|
+
* `Requirement Status` - The status of the cookbook:
|
|
64
|
+
* up-to-date (a green tick mark): the right version is picked
|
|
65
|
+
* warning-req (a yellow esclamation point): a newer version could be used
|
|
66
|
+
* error (a red x mark): no versions could be found
|
|
67
|
+
* `Chef Server Status` - The status of the chef server:
|
|
68
|
+
* up-to-date (a green tick mark): the server is up to date
|
|
69
|
+
* warning-chef (a blue 'i'): on the Repository Manager there's a newer version
|
|
70
|
+
* error (a red x mark): no versions could be found
|
|
71
|
+
* `Repository Status` - The status of the Repository Manager:
|
|
72
|
+
* up-to-date (a green tick mark): the server is up to date
|
|
73
|
+
* warning-repomanager (two yellow esclamation points): on Chef there's a newer version
|
|
74
|
+
* error (a red x mark): no versions could be found
|
|
75
|
+
* `Remarks` - human readable descriptions of warnings/errors
|
|
53
76
|
|
|
54
77
|
The overall status will also be displayed in the bottom of the table.
|
|
55
78
|
|
|
@@ -62,26 +85,232 @@ Two display formats are supported: table and json
|
|
|
62
85
|
|
|
63
86
|
### Examples
|
|
64
87
|
|
|
65
|
-
|
|
66
|
-
| Name
|
|
67
|
-
|
|
|
68
|
-
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
| database
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
77
|
-
|
|
88
|
+
+------------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
89
|
+
| Name | Requirement | Used | Chef | Repository | Requirement | Chef Server | Repository |
|
|
90
|
+
| | | | Latest | Latest | Status | Status | Status |
|
|
91
|
+
+------------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
92
|
+
| apache2 | = 1.8.2 | 1.8.2 | 1.8.2 | 1.8.4 | ✔ | i | ✔ |
|
|
93
|
+
| mysql | = 1.1.2 | 1.1.2 | 1.1.3 | 1.1.4 | ! | i | ✔ |
|
|
94
|
+
| database | = 1.5.3 | 1.5.3 | 1.5.3 | 1.5.2 | ✔ | ✔ | !! |
|
|
95
|
+
| postgresql | = 3.1.0 | | 3.0.5 | 3.1.0 | ✖ | i | ✔ |
|
|
96
|
+
| activemq | = 1.1.0 | 1.1.0 | 1.1.1 | 1.1.1 | ! | ✔ | ✔ |
|
|
97
|
+
| yum | = 2.3.4 | 2.3.4 | 2.3.4 | 2.3.4 | ✔ | ✔ | ✔ |
|
|
98
|
+
| ssh-keys | = 1.0.0 | 1.0.0 | 1.0.0 | | ✔ | ✔ | ✖ |
|
|
99
|
+
| selinux | = 0.5.6 | 0.5.6 | 0.5.6 | 0.5.6 | ✔ | ✔ | ✔ |
|
|
100
|
+
| › keytool | ~> 1.0.0 | 1.0.1 | 1.0.1 | 1.0.1 | ✔ | ✔ | ✔ |
|
|
101
|
+
+------------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
102
|
+
Status: err (✖)
|
|
103
|
+
|
|
104
|
+
**Note:** The option *--remarks* provides more verbose descriptions for errors/warnings
|
|
105
|
+
|
|
106
|
+
$ kitchen-inspector --remarks
|
|
107
|
+
+------------------+-------------+--------+--------+------------+-------------+-------------+------------+---------+
|
|
108
|
+
| Name | Requirement | Used | Chef | Repository | Requirement | Chef Server | Repository | Remarks |
|
|
109
|
+
| | | | Latest | Latest | Status | Status | Status | |
|
|
110
|
+
+------------------+-------------+--------+--------+------------+-------------+-------------+------------+---------+
|
|
111
|
+
| apache2 | = 1.8.2 | 1.8.2 | 1.8.2 | 1.8.2 | ✔ | ✔ | ! | 1 |
|
|
112
|
+
| mysql | = 1.1.3 | 1.1.3 | 1.1.3 | 1.1.4 | ✔ | i | ✔ | 2 |
|
|
113
|
+
| postgresql | = 3.0.5 | 3.0.5 | 3.0.5 | 3.0.5 | ✔ | ✔ | ! | 3 |
|
|
114
|
+
| build-essential | ~> 1.4.2 | 1.4.2 | 1.4.2 | 1.4.2 | ✔ | ✔ | ✔ | |
|
|
115
|
+
| database | >= 0.0.0 | 1.5.3 | 1.5.3 | 1.5.2 | ✔ | ✔ | !! | 4 |
|
|
116
|
+
+------------------+-------------+--------+--------+------------+-------------+-------------+------------+---------+
|
|
117
|
+
Status: warn-outofdate-repo (!!)
|
|
118
|
+
|
|
119
|
+
Remarks:
|
|
120
|
+
[1]: GitLab's last tag is 1.8.4 but found 1.8.2 in metadata.rb
|
|
121
|
+
[2]: A new version might appear on Chef server
|
|
122
|
+
[3]: GitLab's last tag is 3.1.0 but found 3.0.5 in metadata.rb
|
|
123
|
+
[4]: GitLab out-of-date!
|
|
124
|
+
|
|
125
|
+
### Recursive dependencies
|
|
126
|
+
|
|
127
|
+
In order to turn off recursive analysis, simply use _--recursive false_.
|
|
128
|
+
|
|
129
|
+
## Configuration
|
|
130
|
+
|
|
131
|
+
By default *${HOME}/.chef/kitchen_inspector.rb* is picked, but _--config_ can be used to override that setting.
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
$ kitchen-inspector --config config_example.rb
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Chef server
|
|
138
|
+
|
|
139
|
+
Example:
|
|
140
|
+
|
|
141
|
+
```ruby
|
|
142
|
+
# Chef Server configuration
|
|
143
|
+
chef_server :url => "https://chefsrv.example.org",
|
|
144
|
+
:username => "chef_usename",
|
|
145
|
+
:client_pem => "/path/to/chef_client_pem"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### GitLab
|
|
149
|
+
|
|
150
|
+
GitLab access can be configured specifying a *token* and a *base_url*.
|
|
151
|
+
|
|
152
|
+
Example:
|
|
153
|
+
|
|
154
|
+
```ruby
|
|
155
|
+
# Repository Manager configuration
|
|
156
|
+
repository_manager :type => "GitLab",
|
|
157
|
+
:base_url => "http://gitlab.example.org",
|
|
158
|
+
:token => "gitlab_token" # (GitLab > Profile > Account)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### GitHub
|
|
162
|
+
|
|
163
|
+
GitHub access can be configured specifying a *token* and a list of *allowed users* that
|
|
164
|
+
host the cookbooks you're interested in.
|
|
165
|
+
|
|
166
|
+
*PLEASE NOTE* that GitHub has a strict [rate limit](http://developer.github.com/v3/#rate-limiting) on the calls you can make.
|
|
167
|
+
So, even though a *token* is not strictly required, it's better to configure it as well.
|
|
168
|
+
From [GitHub's Applications page](https://github.com/settings/applications) go to "Personal Access Tokens" and generate a new token.
|
|
169
|
+
|
|
170
|
+
Example:
|
|
171
|
+
|
|
172
|
+
```ruby
|
|
173
|
+
# Repository Manager configuration
|
|
174
|
+
repository_manager :type => "GitHub",
|
|
175
|
+
:token => "github_token",
|
|
176
|
+
:allowed_users => ["opscode-cookbooks"]
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## CI/CD Integration
|
|
180
|
+
|
|
181
|
+
Kitchen Inspector can be used in a Continuous Integration/Continuous Building/etc process, in order to validate cookbooks.
|
|
182
|
+
|
|
183
|
+
These are the available exit codes (see *common.rb*):
|
|
184
|
+
|
|
185
|
+
* 0 (:up_to_date): everything is OK!
|
|
186
|
+
* Errors
|
|
187
|
+
* 100 (:err_req): a valid version could not be found
|
|
188
|
+
* 101 (:err_repo): an error related to the Repository Manager
|
|
189
|
+
* 102 (:err_config): configuration error
|
|
190
|
+
* 103 (:err_notacookbok): the specified directory is not a Cookbook
|
|
191
|
+
* Warnings
|
|
192
|
+
* 200 (:warn_req): a newer version could be used
|
|
193
|
+
* 201 (:warn_mismatch_repo): metadata.rb's version and tag doesn't match
|
|
194
|
+
* 202 (:warn_outofdate_repo): a newer version exists on Chef Server
|
|
195
|
+
* 203 (:warn_chef): a newer version exists on Repository Manager
|
|
196
|
+
|
|
197
|
+
## Checks
|
|
198
|
+
|
|
199
|
+
In this section are listed the checks applied.
|
|
200
|
+
|
|
201
|
+
#### Everything is up to date
|
|
202
|
+
|
|
203
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
204
|
+
| Name | Requirement | Used | Chef | Repository | Requirement | Chef Server | Repository |
|
|
205
|
+
| | | | Latest | Latest | Status | Status | Status |
|
|
206
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
207
|
+
| Test | ~> 1.0.0 | 1.0.1 | 1.0.1 | 1.0.1 | ✔ | ✔ | ✔ |
|
|
208
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
209
|
+
Status: up-to-date (✔)
|
|
210
|
+
|
|
211
|
+
#### Repository Manager doesn't contain any versions
|
|
212
|
+
|
|
213
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
214
|
+
| Name | Requirement | Used | Chef | Repository | Requirement | Chef Server | Repository |
|
|
215
|
+
| | | | Latest | Latest | Status | Status | Status |
|
|
216
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
217
|
+
| Test | ~> 1.0.0 | 1.0.1 | 1.0.1 | | ✔ | ✔ | ✖ |
|
|
218
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
219
|
+
Status: err-repo (✖)
|
|
220
|
+
|
|
221
|
+
#### Repository Manager contains a mismatched tag/metadata's version
|
|
222
|
+
|
|
223
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
224
|
+
| Name | Requirement | Used | Chef | Repository | Requirement | Chef Server | Repository |
|
|
225
|
+
| | | | Latest | Latest | Status | Status | Status |
|
|
226
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
227
|
+
| Test | ~> 1.0.0 | 1.0.1 | 1.0.1 | 1.0.0 | ✔ | ✔ | ! |
|
|
228
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
229
|
+
Status: warn-mismatch-repo (!)
|
|
230
|
+
|
|
231
|
+
#### Repository Manager doesn't contain the last version
|
|
232
|
+
|
|
233
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
234
|
+
| Name | Requirement | Used | Chef | Repository | Requirement | Chef Server | Repository |
|
|
235
|
+
| | | | Latest | Latest | Status | Status | Status |
|
|
236
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
237
|
+
| Test | ~> 1.0.0 | 1.0.1 | 1.0.1 | 1.0.0 | ✔ | ✔ | !! |
|
|
238
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
239
|
+
Status: warn-outofdate-repo (!!)
|
|
240
|
+
|
|
241
|
+
#### Chef Server doesn't contain the last version
|
|
242
|
+
|
|
243
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
244
|
+
| Name | Requirement | Used | Chef | Repository | Requirement | Chef Server | Repository |
|
|
245
|
+
| | | | Latest | Latest | Status | Status | Status |
|
|
246
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
247
|
+
| Test | ~> 1.0.0 | 1.0.0 | 1.0.0 | 1.0.1 | ✔ | i | ✔ |
|
|
248
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
249
|
+
Status: warn-chef (i)
|
|
250
|
+
|
|
251
|
+
#### Metadata doesn't use the last version
|
|
252
|
+
|
|
253
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
254
|
+
| Name | Requirement | Used | Chef | Repository | Requirement | Chef Server | Repository |
|
|
255
|
+
| | | | Latest | Latest | Status | Status | Status |
|
|
256
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
257
|
+
| Test | = 1.0.0 | 1.0.0 | 1.0.1 | 1.0.1 | ! | ✔ | ✔ |
|
|
258
|
+
+------+-------------+-------+--------+------------+-------------+-------------+------------+
|
|
259
|
+
Status: warn-req (!)
|
|
260
|
+
|
|
261
|
+
#### Metadata refers to a version not existing on Chef Server
|
|
262
|
+
+------+-------------+------+--------+------------+-------------+-------------+------------+
|
|
263
|
+
| Name | Requirement | Used | Chef | Repository | Requirement | Chef Server | Repository |
|
|
264
|
+
| | | | Latest | Latest | Status | Status | Status |
|
|
265
|
+
+------+-------------+------+--------+------------+-------------+-------------+------------+
|
|
266
|
+
| Test | ~> 1.0.0 | | 1.1.0 | 1.1.0 | ✖ | ✔ | ✔ |
|
|
267
|
+
+------+-------------+------+--------+------------+-------------+-------------+------------+
|
|
268
|
+
Status: err (✖)
|
|
269
|
+
|
|
270
|
+
#### Chef Server doesn't contain any versions
|
|
271
|
+
|
|
272
|
+
+------+-------------+------+--------+------------+-------------+-------------+------------+
|
|
273
|
+
| Name | Requirement | Used | Chef | Repository | Requirement | Chef Server | Repository |
|
|
274
|
+
| | | | Latest | Latest | Status | Status | Status |
|
|
275
|
+
+------+-------------+------+--------+------------+-------------+-------------+------------+
|
|
276
|
+
| Test | ~> 1.0.0 | | | 1.0.1 | ✖ | ✖ | ✔ |
|
|
277
|
+
+------+-------------+------+--------+------------+-------------+-------------+------------+
|
|
278
|
+
Status: err (✖)
|
|
279
|
+
|
|
280
|
+
#### Repository Manager contains two or more projects with the same name
|
|
281
|
+
|
|
282
|
+
**Note:** In this situation is not possible to decide which version generated the one on the Chef Server.
|
|
283
|
+
|
|
284
|
+
+----------+-------------+-------+--------+------------+-------------+-------------+------------+---------+
|
|
285
|
+
| Name | Requirement | Used | Chef | Repository | Requirement | Chef Server | Repository | Remarks |
|
|
286
|
+
| | | | Latest | Latest | Status | Status | Status | |
|
|
287
|
+
+----------+-------------+-------+--------+------------+-------------+-------------+------------+---------+
|
|
288
|
+
| database | >= 0.0.0 | 1.5.2 | 1.5.2 | 1.5.2 | ✔ | ✔ | ? | 1 |
|
|
289
|
+
| database | >= 0.0.0 | 1.5.2 | 1.5.2 | 1.1.0 | ✔ | ✔ | ? | 2 |
|
|
290
|
+
+----------+-------------+-------+--------+------------+-------------+-------------+------------+---------+
|
|
291
|
+
Status: warn-notunique-repo (?)
|
|
292
|
+
|
|
293
|
+
Remarks:
|
|
294
|
+
[1]: Not unique on GitHub (this is github.com/opscode-cookbooks/database)
|
|
295
|
+
[2]: Not unique on GitHub (this is github.com/cookbooks/database)
|
|
296
|
+
|
|
297
|
+
## Testing
|
|
298
|
+
|
|
299
|
+
Kitchen Inspector is tested using RSpec.
|
|
300
|
+
You can run tests using:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
$ rake test
|
|
304
|
+
```
|
|
78
305
|
|
|
79
306
|
## LICENSE
|
|
80
307
|
|
|
81
|
-
Author:: Stefano Tortarolo
|
|
308
|
+
Author:: Stefano Tortarolo (stefano.tortarolo@gmail.com)
|
|
82
309
|
|
|
83
310
|
Copyright:: Copyright (c) 2013
|
|
84
311
|
License:: MIT License
|
|
85
312
|
|
|
86
313
|
## CREDITS
|
|
87
314
|
This code was heavily inspired by Kannan Manickam's [chef-taste](https://github.com/arangamani/chef-taste)
|
|
315
|
+
|
|
316
|
+
Special thanks to [Marco Boschetti](https://github.com/mbizkit76) for the huge amount of suggestions given.
|
data/Rakefile
CHANGED
|
@@ -1 +1,42 @@
|
|
|
1
1
|
require "bundler/gem_tasks"
|
|
2
|
+
require "rspec/core/rake_task"
|
|
3
|
+
|
|
4
|
+
RSpec::Core::RakeTask.new
|
|
5
|
+
|
|
6
|
+
def gemspec
|
|
7
|
+
@gemspec ||= eval(File.read('kitchen-inspector.gemspec'), binding, 'kitchen-inspector.gemspec')
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
task :default => :build
|
|
11
|
+
|
|
12
|
+
task :test => :spec
|
|
13
|
+
|
|
14
|
+
desc 'Builds the documentation using YARD'
|
|
15
|
+
task :doc do
|
|
16
|
+
gem_path = Dir.pwd
|
|
17
|
+
command = "yard doc #{gem_path}/lib -m markdown -o #{gem_path}/doc "
|
|
18
|
+
command += "-r #{gem_path}/README.md --private --protected"
|
|
19
|
+
|
|
20
|
+
sh(command)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
desc "Build gem locally"
|
|
24
|
+
task :build do
|
|
25
|
+
gemspec.validate
|
|
26
|
+
|
|
27
|
+
system "gem build #{gemspec.name}.gemspec"
|
|
28
|
+
FileUtils.mkdir_p "pkg"
|
|
29
|
+
FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "pkg"
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
desc "Install gem locally"
|
|
33
|
+
task :install => :build do
|
|
34
|
+
system "gem install pkg/#{gemspec.name}-#{gemspec.version}.gem"
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
desc "Clean rake artifacts"
|
|
38
|
+
task :clean do
|
|
39
|
+
FileUtils.rm_rf ".yardoc"
|
|
40
|
+
FileUtils.rm_rf "doc"
|
|
41
|
+
FileUtils.rm_rf "pkg"
|
|
42
|
+
end
|