berkshelf 5.2.0 → 8.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +19 -47
- data/Rakefile +14 -4
- data/berkshelf.gemspec +61 -40
- data/bin/berks +2 -2
- data/lib/berkshelf/api-client.rb +1 -0
- data/lib/berkshelf/api_client/chef_server_connection.rb +29 -0
- data/lib/berkshelf/api_client/connection.rb +57 -0
- data/lib/berkshelf/api_client/errors.rb +10 -0
- data/lib/berkshelf/api_client/remote_cookbook.rb +56 -0
- data/lib/berkshelf/api_client/version.rb +5 -0
- data/lib/berkshelf/api_client.rb +24 -0
- data/lib/berkshelf/berksfile.rb +149 -122
- data/lib/berkshelf/cached_cookbook.rb +127 -24
- data/lib/berkshelf/chef_config_compat.rb +51 -0
- data/lib/berkshelf/chef_repo_universe.rb +47 -0
- data/lib/berkshelf/cli.rb +143 -174
- data/lib/berkshelf/commands/shelf.rb +20 -19
- data/lib/berkshelf/community_rest.rb +59 -94
- data/lib/berkshelf/config.rb +97 -127
- data/lib/berkshelf/cookbook_store.rb +7 -6
- data/lib/berkshelf/core_ext/file.rb +1 -1
- data/lib/berkshelf/core_ext/file_utils.rb +4 -4
- data/lib/berkshelf/core_ext.rb +1 -1
- data/lib/berkshelf/dependency.rb +25 -32
- data/lib/berkshelf/downloader.rb +66 -39
- data/lib/berkshelf/errors.rb +23 -17
- data/lib/berkshelf/file_syncer.rb +24 -47
- data/lib/berkshelf/formatters/human.rb +7 -5
- data/lib/berkshelf/formatters/json.rb +6 -6
- data/lib/berkshelf/installer.rb +120 -111
- data/lib/berkshelf/location.rb +14 -14
- data/lib/berkshelf/locations/base.rb +1 -1
- data/lib/berkshelf/locations/git.rb +16 -24
- data/lib/berkshelf/locations/github.rb +2 -2
- data/lib/berkshelf/locations/path.rb +2 -2
- data/lib/berkshelf/lockfile.rb +326 -328
- data/lib/berkshelf/logger.rb +64 -1
- data/lib/berkshelf/mixin/git.rb +6 -5
- data/lib/berkshelf/packager.rb +44 -10
- data/lib/berkshelf/resolver/graph.rb +1 -1
- data/lib/berkshelf/resolver.rb +4 -4
- data/lib/berkshelf/ridley_compat.rb +109 -0
- data/lib/berkshelf/shell.rb +2 -1
- data/lib/berkshelf/shell_out.rb +18 -0
- data/lib/berkshelf/source.rb +77 -33
- data/lib/berkshelf/source_uri.rb +4 -4
- data/lib/berkshelf/ssl_policies.rb +38 -0
- data/lib/berkshelf/thor.rb +1 -1
- data/lib/berkshelf/thor_ext/hash_with_indifferent_access.rb +1 -1
- data/lib/berkshelf/thor_ext.rb +1 -1
- data/lib/berkshelf/uploader.rb +106 -70
- data/lib/berkshelf/validator.rb +13 -5
- data/lib/berkshelf/version.rb +1 -1
- data/lib/berkshelf/visualizer.rb +16 -11
- data/lib/berkshelf.rb +106 -81
- data/spec/config/knife.rb +4 -4
- data/spec/data/trusted_certs/example.crt +22 -0
- data/spec/fixtures/Berksfile +3 -3
- data/spec/fixtures/complex-cookbook-path/cookbooks/app/metadata.rb +2 -0
- data/spec/fixtures/complex-cookbook-path/cookbooks/jenkins/metadata.rb +2 -0
- data/spec/fixtures/complex-cookbook-path/cookbooks/jenkins-config/metadata.rb +4 -0
- data/spec/fixtures/cookbook-path/jenkins-config/metadata.rb +3 -3
- data/spec/fixtures/cookbook-path-uploader/apt-2.3.6/metadata.rb +2 -0
- data/spec/fixtures/cookbook-path-uploader/build-essential-1.4.2/metadata.rb +2 -0
- data/spec/fixtures/cookbook-path-uploader/jenkins-2.0.3/metadata.rb +5 -0
- data/spec/fixtures/cookbook-path-uploader/jenkins-config-0.1.0/metadata.rb +4 -0
- data/spec/fixtures/cookbook-path-uploader/runit-1.5.8/metadata.rb +5 -0
- data/spec/fixtures/cookbook-path-uploader/yum-3.0.6/metadata.rb +2 -0
- data/spec/fixtures/cookbook-path-uploader/yum-epel-0.2.0/metadata.rb +3 -0
- data/spec/fixtures/cookbook-store/jenkins-2.0.3/metadata.rb +5 -5
- data/spec/fixtures/cookbook-store/jenkins-2.0.4/metadata.rb +4 -4
- data/spec/fixtures/cookbooks/example_cookbook/metadata.rb +3 -3
- data/spec/fixtures/cookbooks/example_cookbook-0.5.0/metadata.rb +3 -3
- data/spec/spec_helper.rb +56 -64
- data/spec/support/chef_api.rb +15 -16
- data/spec/support/chef_server.rb +71 -69
- data/spec/support/git.rb +59 -58
- data/spec/support/kitchen.rb +0 -14
- data/spec/support/matchers/file_system_matchers.rb +4 -5
- data/spec/support/matchers/filepath_matchers.rb +2 -2
- data/spec/support/path_helpers.rb +17 -17
- data/spec/support/shared_examples/formatter.rb +1 -1
- data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/attributes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/files/default/file.h +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/metadata.rb +2 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/recipes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/templates/default/template.erb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/attributes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/files/default/file.h +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/metadata.rb +2 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/recipes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/templates/default/template.erb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/attributes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/files/default/file.h +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/metadata.rb +2 -0
- data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/recipes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/templates/default/template.erb +0 -0
- data/spec/unit/berkshelf/berksfile_spec.rb +84 -105
- data/spec/unit/berkshelf/berkshelf/api_client/chef_server_connection_spec.rb +65 -0
- data/spec/unit/berkshelf/berkshelf/api_client/connection_spec.rb +157 -0
- data/spec/unit/berkshelf/berkshelf/api_client/remote_cookbook_spec.rb +23 -0
- data/spec/unit/berkshelf/berkshelf/api_client_spec.rb +9 -0
- data/spec/unit/berkshelf/cached_cookbook_spec.rb +45 -47
- data/spec/unit/berkshelf/chef_repo_universe_spec.rb +37 -0
- data/spec/unit/berkshelf/cli_spec.rb +7 -8
- data/spec/unit/berkshelf/community_rest_spec.rb +82 -90
- data/spec/unit/berkshelf/config_spec.rb +51 -22
- data/spec/unit/berkshelf/cookbook_store_spec.rb +41 -41
- data/spec/unit/berkshelf/core_ext/file_utils_spec.rb +7 -8
- data/spec/unit/berkshelf/core_ext/pathname_spec.rb +1 -1
- data/spec/unit/berkshelf/dependency_spec.rb +48 -48
- data/spec/unit/berkshelf/downloader_spec.rb +191 -34
- data/spec/unit/berkshelf/errors_spec.rb +3 -3
- data/spec/unit/berkshelf/file_syncer_spec.rb +87 -87
- data/spec/unit/berkshelf/formatters/base_spec.rb +23 -23
- data/spec/unit/berkshelf/formatters/human_spec.rb +2 -2
- data/spec/unit/berkshelf/formatters/json_spec.rb +2 -2
- data/spec/unit/berkshelf/formatters/null_spec.rb +3 -3
- data/spec/unit/berkshelf/installer_spec.rb +8 -8
- data/spec/unit/berkshelf/location_spec.rb +11 -11
- data/spec/unit/berkshelf/locations/base_spec.rb +35 -36
- data/spec/unit/berkshelf/locations/git_spec.rb +90 -93
- data/spec/unit/berkshelf/locations/path_spec.rb +40 -41
- data/spec/unit/berkshelf/lockfile_parser_spec.rb +71 -71
- data/spec/unit/berkshelf/lockfile_spec.rb +205 -211
- data/spec/unit/berkshelf/logger_spec.rb +3 -3
- data/spec/unit/berkshelf/mixin/logging_spec.rb +5 -5
- data/spec/unit/berkshelf/packager_spec.rb +2 -2
- data/spec/unit/berkshelf/resolver/graph_spec.rb +10 -8
- data/spec/unit/berkshelf/resolver_spec.rb +17 -17
- data/spec/unit/berkshelf/ridley_compat_spec.rb +16 -0
- data/spec/unit/berkshelf/shell_spec.rb +34 -34
- data/spec/unit/berkshelf/source_spec.rb +186 -20
- data/spec/unit/berkshelf/source_uri_spec.rb +1 -1
- data/spec/unit/berkshelf/ssl_policies_spec.rb +86 -0
- data/spec/unit/berkshelf/uploader_spec.rb +146 -64
- data/spec/unit/berkshelf/validator_spec.rb +23 -16
- data/spec/unit/berkshelf/visualizer_spec.rb +24 -15
- data/spec/unit/berkshelf_spec.rb +18 -18
- metadata +138 -289
- data/.gitignore +0 -29
- data/.travis.yml +0 -64
- data/CHANGELOG.legacy.md +0 -307
- data/CHANGELOG.md +0 -1358
- data/CONTRIBUTING.md +0 -64
- data/Gemfile.lock +0 -399
- data/Guardfile +0 -23
- data/PLUGINS.md +0 -25
- data/README.md +0 -70
- data/Thorfile +0 -61
- data/appveyor.yml +0 -31
- data/docs/berkshelf_for_newcomers.md +0 -65
- data/features/berksfile.feature +0 -46
- data/features/commands/apply.feature +0 -41
- data/features/commands/contingent.feature +0 -48
- data/features/commands/cookbook.feature +0 -35
- data/features/commands/info.feature +0 -99
- data/features/commands/init.feature +0 -27
- data/features/commands/install.feature +0 -636
- data/features/commands/list.feature +0 -78
- data/features/commands/outdated.feature +0 -130
- data/features/commands/package.feature +0 -17
- data/features/commands/search.feature +0 -17
- data/features/commands/shelf/list.feature +0 -32
- data/features/commands/shelf/show.feature +0 -143
- data/features/commands/shelf/uninstall.feature +0 -96
- data/features/commands/show.feature +0 -83
- data/features/commands/update.feature +0 -142
- data/features/commands/upload.feature +0 -426
- data/features/commands/vendor.feature +0 -111
- data/features/commands/verify.feature +0 -29
- data/features/commands/viz.feature +0 -66
- data/features/community_site.feature +0 -37
- data/features/config.feature +0 -111
- data/features/help.feature +0 -11
- data/features/json_formatter.feature +0 -161
- data/features/lifecycle.feature +0 -378
- data/features/lockfile.feature +0 -378
- data/features/step_definitions/berksfile_steps.rb +0 -39
- data/features/step_definitions/chef/config_steps.rb +0 -12
- data/features/step_definitions/chef_server_steps.rb +0 -60
- data/features/step_definitions/cli_steps.rb +0 -18
- data/features/step_definitions/config_steps.rb +0 -46
- data/features/step_definitions/environment_steps.rb +0 -7
- data/features/step_definitions/filesystem_steps.rb +0 -269
- data/features/step_definitions/gem_steps.rb +0 -13
- data/features/step_definitions/json_steps.rb +0 -23
- data/features/step_definitions/utility_steps.rb +0 -11
- data/features/support/aruba.rb +0 -12
- data/features/support/env.rb +0 -82
- data/generator_files/Berksfile.erb +0 -11
- data/generator_files/CHANGELOG.md.erb +0 -3
- data/generator_files/Gemfile.erb +0 -8
- data/generator_files/README.md.erb +0 -42
- data/generator_files/Thorfile.erb +0 -11
- data/generator_files/Vagrantfile.erb +0 -117
- data/generator_files/chefignore +0 -94
- data/generator_files/default_recipe.erb +0 -6
- data/generator_files/default_test.rb.erb +0 -11
- data/generator_files/gitignore.erb +0 -23
- data/generator_files/helpers.rb.erb +0 -7
- data/generator_files/licenses/apachev2.erb +0 -13
- data/generator_files/licenses/gplv2.erb +0 -15
- data/generator_files/licenses/gplv3.erb +0 -14
- data/generator_files/licenses/mit.erb +0 -20
- data/generator_files/licenses/reserved.erb +0 -3
- data/generator_files/metadata.rb.erb +0 -11
- data/lib/berkshelf/base_generator.rb +0 -43
- data/lib/berkshelf/commands/test_command.rb +0 -13
- data/lib/berkshelf/cookbook_generator.rb +0 -133
- data/lib/berkshelf/init_generator.rb +0 -195
- data/spec/fixtures/cookbooks/example_cookbook/.gitignore +0 -2
- data/spec/fixtures/cookbooks/example_cookbook/.kitchen.yml +0 -26
- data/spec/unit/berkshelf/cookbook_generator_spec.rb +0 -110
- data/spec/unit/berkshelf/init_generator_spec.rb +0 -263
@@ -1,65 +0,0 @@
|
|
1
|
-
# Berkshelf for Newcomers
|
2
|
-
|
3
|
-
Berkshelf is a tool to help manage cookbook dependencies. If your cookbook depends on other cookbooks, Berkshelf lets you do the following:
|
4
|
-
|
5
|
-
* download all cookbooks you depend on to your local machine for development and testing using `berks install`
|
6
|
-
* upload your cookbook and all dependencies to your Chef server using `berks upload`
|
7
|
-
* update your dependencies using `berks update`
|
8
|
-
|
9
|
-
The above are the main Berkshelf commands that will comprise the bulk of your workflow.
|
10
|
-
|
11
|
-
Berkshelf is included in the ChefDK (at least at v.0.10.0), and `chef generate cookbook` will set up your cookbook with the necessary files for Berkshelf usage.
|
12
|
-
|
13
|
-
## A quick example
|
14
|
-
|
15
|
-
Suppose you have a cookbook with the following `metadata.rb`:
|
16
|
-
|
17
|
-
```
|
18
|
-
name 'example_cookbook'
|
19
|
-
description 'Installs/Configures example_cookbook'
|
20
|
-
long_description 'Installs/Configures example_cookbook'
|
21
|
-
version '0.1.0'
|
22
|
-
|
23
|
-
depends 'apt', '~> 2.3'
|
24
|
-
```
|
25
|
-
|
26
|
-
To work on this cookbook locally, you need to download an `apt` cookbook matching the constraints. Berkshelf handles this for you:
|
27
|
-
|
28
|
-
```
|
29
|
-
$ berks install
|
30
|
-
Resolving cookbook dependencies...
|
31
|
-
Fetching 'example_cookbook' from source at .
|
32
|
-
Fetching cookbook index from https://supermarket.chef.io...
|
33
|
-
Using example_cookbook (0.1.0) from source at .
|
34
|
-
Using apt (2.9.2)
|
35
|
-
```
|
36
|
-
|
37
|
-
When done your work, you need to push both your cookbook and the apt cookbook up to your Chef server. With Berkshelf:
|
38
|
-
|
39
|
-
```
|
40
|
-
$ berks upload
|
41
|
-
Uploaded apt (2.9.2) to: 'https://your_chef_server_url'
|
42
|
-
Uploaded example_cookbook (0.1.0) to: 'your_chef_server_url'
|
43
|
-
```
|
44
|
-
|
45
|
-
The above is a trivial example. If your cookbook has several dependencies, which in turn have dependencies, Berkshelf handles it all automatically, significantly improving your workflow.
|
46
|
-
|
47
|
-
## What's in the background
|
48
|
-
|
49
|
-
* the cookbook's `metadata.rb` specifies the cookbook dependencies and required versions
|
50
|
-
* the [Berksfile](http://berkshelf.com/v2.0/#the-berksfile) in your cookbook's root directory tells Berkshelf where to find cookbooks. You can have multiple sources, or can pull individual cookbooks from specific locations, such as your own Supermarket, GitHub, or a file server.
|
51
|
-
* `berks install` downloads cookbooks and their dependencies to the [Berkshelf](http://berkshelf.com/v2.0/#the-berkshelf), a place on your local disk.
|
52
|
-
* a Berksfile.lock is generated on `berks install` which specifies the exact cookbook versions that were used at that point
|
53
|
-
|
54
|
-
## Cookbook versioning
|
55
|
-
|
56
|
-
Berkshelf relies on cookbook versioning to work correctly. A cookbook's version is tracked in its `metadata.rb`, and should follow the guidelines outlined at http://semver.org/.
|
57
|
-
|
58
|
-
# Further reading
|
59
|
-
|
60
|
-
* The project homepage, http://http://berkshelf.com/v2.0/
|
61
|
-
* https://sethvargo.com/berkshelf-workflow/
|
62
|
-
|
63
|
-
--
|
64
|
-
|
65
|
-
Good luck with Berkshelf!
|
data/features/berksfile.feature
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
Feature: Evaluating a Berksfile
|
2
|
-
Scenario: Containing pure Ruby
|
3
|
-
Given I write to "Berksfile" with:
|
4
|
-
"""
|
5
|
-
source 'https://supermarket.chef.io'
|
6
|
-
|
7
|
-
if ENV['BACON']
|
8
|
-
puts "If you don't got bacon..."
|
9
|
-
else
|
10
|
-
puts "No bacon :'("
|
11
|
-
end
|
12
|
-
"""
|
13
|
-
And the environment variable BACON is "1"
|
14
|
-
When I successfully run `berks install`
|
15
|
-
Then the output should contain:
|
16
|
-
"""
|
17
|
-
If you don't got bacon...
|
18
|
-
"""
|
19
|
-
|
20
|
-
Scenario: Containing methods I shouldn't be able to call
|
21
|
-
Given I write to "Berksfile" with:
|
22
|
-
"""
|
23
|
-
add_location(:foo)
|
24
|
-
"""
|
25
|
-
When I run `berks install`
|
26
|
-
Then the output should contain:
|
27
|
-
"""
|
28
|
-
An error occurred while reading the Berksfile:
|
29
|
-
|
30
|
-
undefined method `add_location' for
|
31
|
-
"""
|
32
|
-
And the exit status should be "BerksfileReadError"
|
33
|
-
|
34
|
-
Scenario: Containing Ruby syntax errors
|
35
|
-
Given I write to "Berksfile" with:
|
36
|
-
"""
|
37
|
-
ptus "This is a ruby syntax error"
|
38
|
-
"""
|
39
|
-
When I run `berks install`
|
40
|
-
Then the output should contain:
|
41
|
-
"""
|
42
|
-
An error occurred while reading the Berksfile:
|
43
|
-
|
44
|
-
undefined method `ptus' for
|
45
|
-
"""
|
46
|
-
And the exit status should be "BerksfileReadError"
|
@@ -1,41 +0,0 @@
|
|
1
|
-
@api_server
|
2
|
-
Feature: berks apply
|
3
|
-
Scenario: Locking a cookbook version with dependencies
|
4
|
-
Given the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
|
5
|
-
| dependency | 2.0.0 |
|
6
|
-
And the cookbook store has the cookbooks:
|
7
|
-
| dependency | 2.0.0 |
|
8
|
-
And the Chef Server has an environment named "my_env"
|
9
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
10
|
-
"""
|
11
|
-
cookbook 'fake', '1.0.0'
|
12
|
-
"""
|
13
|
-
When I successfully run `berks install`
|
14
|
-
And I successfully run `berks apply my_env`
|
15
|
-
Then the version locks in the "my_env" environment should be:
|
16
|
-
| fake | = 1.0.0 |
|
17
|
-
| dependency | = 2.0.0 |
|
18
|
-
|
19
|
-
Scenario: Locking cookbook versions to a non-existent Chef Environment
|
20
|
-
Given the Chef Server does not have an environment named "my_env"
|
21
|
-
And the cookbook store has the cookbooks:
|
22
|
-
| fake | 1.0.0 |
|
23
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
24
|
-
"""
|
25
|
-
cookbook 'fake', '1.0.0'
|
26
|
-
"""
|
27
|
-
When I successfully run `berks install`
|
28
|
-
And I run `berks apply my_env`
|
29
|
-
Then the output should contain:
|
30
|
-
"""
|
31
|
-
The environment 'my_env' does not exist
|
32
|
-
"""
|
33
|
-
And the exit status should be "EnvironmentNotFound"
|
34
|
-
|
35
|
-
Scenario: Locking an environment when no lockfile is present
|
36
|
-
When I run `berks apply my_env`
|
37
|
-
Then the output should contain:
|
38
|
-
"""
|
39
|
-
Lockfile not found! Run `berks install` to create the lockfile.
|
40
|
-
"""
|
41
|
-
And the exit status should be "LockfileNotFound"
|
@@ -1,48 +0,0 @@
|
|
1
|
-
Feature: berks contingent
|
2
|
-
Background:
|
3
|
-
* the Berkshelf API server's cache is empty
|
4
|
-
* the Chef Server is empty
|
5
|
-
* the cookbook store is empty
|
6
|
-
|
7
|
-
Scenario: When there are dependent cookbooks
|
8
|
-
Given the cookbook store has the cookbooks:
|
9
|
-
| dep | 1.0.0 |
|
10
|
-
And the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
|
11
|
-
| dep | ~> 1.0.0 |
|
12
|
-
And the cookbook store contains a cookbook "ekaf" "1.0.0" with dependencies:
|
13
|
-
| dep | ~> 1.0.0 |
|
14
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
15
|
-
"""
|
16
|
-
cookbook 'fake', '1.0.0'
|
17
|
-
cookbook 'ekaf', '1.0.0'
|
18
|
-
"""
|
19
|
-
And I run `berks install`
|
20
|
-
And I successfully run `berks contingent dep`
|
21
|
-
Then the output should contain:
|
22
|
-
"""
|
23
|
-
Cookbooks in this Berksfile contingent upon 'dep':
|
24
|
-
* ekaf (1.0.0)
|
25
|
-
* fake (1.0.0)
|
26
|
-
"""
|
27
|
-
|
28
|
-
Scenario: When there are no dependent cookbooks
|
29
|
-
Given the cookbook store has the cookbooks:
|
30
|
-
| fake | 1.0.0 |
|
31
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
32
|
-
"""
|
33
|
-
cookbook 'fake', '1.0.0'
|
34
|
-
"""
|
35
|
-
And I run `berks install`
|
36
|
-
And I successfully run `berks contingent dep`
|
37
|
-
Then the output should contain:
|
38
|
-
"""
|
39
|
-
There are no cookbooks in this Berksfile contingent upon 'dep'.
|
40
|
-
"""
|
41
|
-
|
42
|
-
Scenario: When the cookbook is not in the Berksfile
|
43
|
-
Given I have a Berksfile pointing at the local Berkshelf API
|
44
|
-
And I successfully run `berks contingent dep`
|
45
|
-
Then the output should contain:
|
46
|
-
"""
|
47
|
-
There are no cookbooks in this Berksfile contingent upon 'dep'.
|
48
|
-
"""
|
@@ -1,35 +0,0 @@
|
|
1
|
-
Feature: berks cookbook
|
2
|
-
Scenario: With the default options
|
3
|
-
When I successfully run `berks cookbook sparkle_motion`
|
4
|
-
Then I should have a new cookbook skeleton "sparkle_motion"
|
5
|
-
|
6
|
-
Scenario Outline: With various options
|
7
|
-
When I successfully run `berks cookbook sparkle_motion --<option>`
|
8
|
-
Then I should have a new cookbook skeleton "sparkle_motion" with <feature> support
|
9
|
-
Examples:
|
10
|
-
| option | feature |
|
11
|
-
| foodcritic | Foodcritic |
|
12
|
-
| chef-minitest | Chef-Minitest |
|
13
|
-
| scmversion | SCMVersion |
|
14
|
-
| no-bundler | no Bundler |
|
15
|
-
# Disable testing of skip git until Test Kitchen supports the skip_git flag in its generator
|
16
|
-
# https://github.com/opscode/test-kitchen/issues/141
|
17
|
-
# | skip-git | no Git |
|
18
|
-
| skip-vagrant | no Vagrant |
|
19
|
-
| skip-test-kitchen | no Test Kitchen |
|
20
|
-
|
21
|
-
Scenario Outline: When a required supporting gem is not installed
|
22
|
-
Given the gem "<gem>" is not installed
|
23
|
-
When I successfully run `berks cookbook sparkle_motion --<option>`
|
24
|
-
Then I should have a new cookbook skeleton "sparkle_motion" with <feature> support
|
25
|
-
And the output should contain a warning to suggest supporting the option "<option>" by installing "<gem>"
|
26
|
-
Examples:
|
27
|
-
| option | feature | gem |
|
28
|
-
| foodcritic | Foodcritic | foodcritic |
|
29
|
-
| scmversion | SCMVersion | thor-scmversion |
|
30
|
-
|
31
|
-
Scenario: When bundler is not installed
|
32
|
-
Given the gem "bundler" is not installed
|
33
|
-
When I successfully run `berks cookbook sparkle_motion`
|
34
|
-
Then I should have a new cookbook skeleton "sparkle_motion"
|
35
|
-
And the output should contain a warning to suggest supporting the default for "bundler" by installing "bundler"
|
@@ -1,99 +0,0 @@
|
|
1
|
-
Feature: berks info
|
2
|
-
Scenario: With no options
|
3
|
-
Given the cookbook store has the cookbooks:
|
4
|
-
| fake | 1.0.0 |
|
5
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
6
|
-
"""
|
7
|
-
cookbook 'fake', '1.0.0'
|
8
|
-
"""
|
9
|
-
And I write to "Berksfile.lock" with:
|
10
|
-
"""
|
11
|
-
DEPENDENCIES
|
12
|
-
fake (= 1.0.0)
|
13
|
-
|
14
|
-
GRAPH
|
15
|
-
fake (1.0.0)
|
16
|
-
"""
|
17
|
-
When I successfully run `berks info fake`
|
18
|
-
Then the output should contain:
|
19
|
-
"""
|
20
|
-
Name: fake
|
21
|
-
Version: 1.0.0
|
22
|
-
Description: A fabulous new cookbook
|
23
|
-
Author: YOUR_COMPANY_NAME
|
24
|
-
Email: YOUR_EMAIL
|
25
|
-
License: none
|
26
|
-
"""
|
27
|
-
|
28
|
-
Scenario: When the parameter is a transitive dependency
|
29
|
-
Given the cookbook store has the cookbooks:
|
30
|
-
| dep | 1.0.0 |
|
31
|
-
And the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
|
32
|
-
| dep | ~> 1.0.0 |
|
33
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
34
|
-
"""
|
35
|
-
cookbook 'fake', '1.0.0'
|
36
|
-
"""
|
37
|
-
And I write to "Berksfile.lock" with:
|
38
|
-
"""
|
39
|
-
DEPENDENCIES
|
40
|
-
fake (= 1.0.0)
|
41
|
-
|
42
|
-
GRAPH
|
43
|
-
dep (1.0.0)
|
44
|
-
fake (1.0.0)
|
45
|
-
dep (~> 1.0.0)
|
46
|
-
"""
|
47
|
-
And I successfully run `berks install`
|
48
|
-
When I successfully run `berks info dep`
|
49
|
-
Then the output should contain:
|
50
|
-
"""
|
51
|
-
Name: dep
|
52
|
-
Version: 1.0.0
|
53
|
-
Description: A fabulous new cookbook
|
54
|
-
Author: YOUR_COMPANY_NAME
|
55
|
-
Email: YOUR_EMAIL
|
56
|
-
License: none
|
57
|
-
"""
|
58
|
-
|
59
|
-
Scenario: When the cookbook is not in the Berksfile
|
60
|
-
Given I have a Berksfile pointing at the local Berkshelf API
|
61
|
-
When I run `berks info fake`
|
62
|
-
Then the output should contain:
|
63
|
-
"""
|
64
|
-
Dependency 'fake' was not found. Please make sure it is in your Berksfile, and then run `berks install` to download and install the missing dependencies.
|
65
|
-
"""
|
66
|
-
And the exit status should be "DependencyNotFound"
|
67
|
-
|
68
|
-
Scenario: When there is no lockfile present
|
69
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
70
|
-
"""
|
71
|
-
cookbook 'fake', '1.0.0'
|
72
|
-
"""
|
73
|
-
When I run `berks info fake`
|
74
|
-
Then the output should contain:
|
75
|
-
"""
|
76
|
-
Dependency 'fake' was not found. Please make sure it is in your Berksfile, and then run `berks install` to download and install the missing dependencies.
|
77
|
-
"""
|
78
|
-
And the exit status should be "DependencyNotFound"
|
79
|
-
|
80
|
-
Scenario: When the cookbook is not installed
|
81
|
-
Given the cookbook store is empty
|
82
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
83
|
-
"""
|
84
|
-
cookbook 'fake', '1.0.0'
|
85
|
-
"""
|
86
|
-
And I write to "Berksfile.lock" with:
|
87
|
-
"""
|
88
|
-
DEPENDENCIES
|
89
|
-
fake (= 1.0.0)
|
90
|
-
|
91
|
-
GRAPH
|
92
|
-
fake (1.0.0)
|
93
|
-
"""
|
94
|
-
When I run `berks info fake`
|
95
|
-
Then the output should contain:
|
96
|
-
"""
|
97
|
-
Cookbook 'fake' (1.0.0) not found in the cookbook store!
|
98
|
-
"""
|
99
|
-
And the exit status should be "CookbookNotFound"
|
@@ -1,27 +0,0 @@
|
|
1
|
-
Feature: berks init
|
2
|
-
Scenario: initializing a path containing a cookbook
|
3
|
-
Given a cookbook named "sparkle_motion"
|
4
|
-
When I successfully run `berks init sparkle_motion`
|
5
|
-
Then the cookbook "sparkle_motion" should have the following files:
|
6
|
-
| Berksfile |
|
7
|
-
| chefignore |
|
8
|
-
And the file "Berksfile" in the cookbook "sparkle_motion" should contain:
|
9
|
-
"""
|
10
|
-
metadata
|
11
|
-
"""
|
12
|
-
And the output should contain "Successfully initialized"
|
13
|
-
|
14
|
-
Scenario: initializing a path that does not contain a cookbook
|
15
|
-
Given a directory named "not_a_cookbook"
|
16
|
-
When I run `berks init not_a_cookbook`
|
17
|
-
And the exit status should be "NotACookbook"
|
18
|
-
|
19
|
-
Scenario: initializing with no value given for target
|
20
|
-
Given I write to "metadata.rb" with:
|
21
|
-
"""
|
22
|
-
name 'sparkle_motion'
|
23
|
-
"""
|
24
|
-
When I successfully run `berks init`
|
25
|
-
Then the output should contain "Successfully initialized"
|
26
|
-
And a file named "Berksfile" should exist
|
27
|
-
And a file named "chefignore" should exist
|