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,142 +0,0 @@
|
|
1
|
-
@api_server
|
2
|
-
Feature: berks update
|
3
|
-
Background:
|
4
|
-
* the cookbook store has the cookbooks:
|
5
|
-
| fake | 0.1.0 |
|
6
|
-
| fake | 0.2.0 |
|
7
|
-
| fake | 1.0.0 |
|
8
|
-
| ekaf | 1.0.0 |
|
9
|
-
| ekaf | 1.0.1 |
|
10
|
-
|
11
|
-
Scenario: Without a cookbook specified
|
12
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
13
|
-
"""
|
14
|
-
cookbook 'ekaf', '~> 1.0.0'
|
15
|
-
cookbook 'fake', '~> 0.1'
|
16
|
-
"""
|
17
|
-
And I write to "Berksfile.lock" with:
|
18
|
-
"""
|
19
|
-
DEPENDENCIES
|
20
|
-
ekaf (~> 1.0.0)
|
21
|
-
fake (~> 0.1)
|
22
|
-
|
23
|
-
GRAPH
|
24
|
-
ekaf (1.0.0)
|
25
|
-
fake (0.1.0)
|
26
|
-
"""
|
27
|
-
When I successfully run `berks update`
|
28
|
-
Then the file "Berksfile.lock" should contain:
|
29
|
-
"""
|
30
|
-
DEPENDENCIES
|
31
|
-
ekaf (~> 1.0.0)
|
32
|
-
fake (~> 0.1)
|
33
|
-
|
34
|
-
GRAPH
|
35
|
-
ekaf (1.0.1)
|
36
|
-
fake (0.2.0)
|
37
|
-
"""
|
38
|
-
|
39
|
-
Scenario: With a single cookbook specified
|
40
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
41
|
-
"""
|
42
|
-
cookbook 'ekaf', '~> 1.0.0'
|
43
|
-
cookbook 'fake', '~> 0.1'
|
44
|
-
"""
|
45
|
-
And I write to "Berksfile.lock" with:
|
46
|
-
"""
|
47
|
-
DEPENDENCIES
|
48
|
-
ekaf (~> 1.0.0)
|
49
|
-
fake (~> 0.1)
|
50
|
-
|
51
|
-
GRAPH
|
52
|
-
ekaf (1.0.0)
|
53
|
-
fake (0.1.0)
|
54
|
-
"""
|
55
|
-
When I successfully run `berks update fake`
|
56
|
-
Then the file "Berksfile.lock" should contain:
|
57
|
-
"""
|
58
|
-
DEPENDENCIES
|
59
|
-
ekaf (~> 1.0.0)
|
60
|
-
fake (~> 0.1)
|
61
|
-
|
62
|
-
GRAPH
|
63
|
-
ekaf (1.0.0)
|
64
|
-
fake (0.2.0)
|
65
|
-
"""
|
66
|
-
|
67
|
-
Scenario: With a transitive dependency specified
|
68
|
-
Given the cookbook store contains a cookbook "seth" "1.0.0" with dependencies:
|
69
|
-
| fake | ~> 0.1 |
|
70
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
71
|
-
"""
|
72
|
-
cookbook 'seth', '1.0.0'
|
73
|
-
"""
|
74
|
-
And I write to "Berksfile.lock" with:
|
75
|
-
"""
|
76
|
-
DEPENDENCIES
|
77
|
-
seth (= 1.0.0)
|
78
|
-
|
79
|
-
GRAPH
|
80
|
-
fake (0.1.0)
|
81
|
-
seth (1.0.0)
|
82
|
-
fake (~> 0.1)
|
83
|
-
"""
|
84
|
-
When I successfully run `berks update fake`
|
85
|
-
Then the file "Berksfile.lock" should contain:
|
86
|
-
"""
|
87
|
-
DEPENDENCIES
|
88
|
-
seth (= 1.0.0)
|
89
|
-
|
90
|
-
GRAPH
|
91
|
-
fake (0.2.0)
|
92
|
-
seth (1.0.0)
|
93
|
-
fake (~> 0.1)
|
94
|
-
"""
|
95
|
-
|
96
|
-
Scenario: With a git location
|
97
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
98
|
-
"""
|
99
|
-
cookbook 'berkshelf-cookbook-fixture', git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture'
|
100
|
-
"""
|
101
|
-
And I write to "Berksfile.lock" with:
|
102
|
-
"""
|
103
|
-
DEPENDENCIES
|
104
|
-
berkshelf-cookbook-fixture
|
105
|
-
git: git://github.com/RiotGames/berkshelf-cookbook-fixture
|
106
|
-
revision: 70a527e17d91f01f031204562460ad1c17f972ee
|
107
|
-
|
108
|
-
GRAPH
|
109
|
-
berkshelf-cookbook-fixture (0.2.0)
|
110
|
-
"""
|
111
|
-
And I successfully run `berks install`
|
112
|
-
When I successfully run `berks update`
|
113
|
-
Then the file "Berksfile.lock" should contain:
|
114
|
-
"""
|
115
|
-
DEPENDENCIES
|
116
|
-
berkshelf-cookbook-fixture
|
117
|
-
git: git://github.com/RiotGames/berkshelf-cookbook-fixture
|
118
|
-
revision: a97b9447cbd41a5fe58eee2026e48ccb503bd3bc
|
119
|
-
|
120
|
-
GRAPH
|
121
|
-
berkshelf-cookbook-fixture (1.0.0)
|
122
|
-
"""
|
123
|
-
|
124
|
-
Scenario: With a cookbook that does not exist
|
125
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
126
|
-
"""
|
127
|
-
cookbook 'fake'
|
128
|
-
"""
|
129
|
-
And I write to "Berksfile.lock" with:
|
130
|
-
"""
|
131
|
-
DEPENDENCIES
|
132
|
-
fake
|
133
|
-
|
134
|
-
GRAPH
|
135
|
-
fake (0.2.0)
|
136
|
-
"""
|
137
|
-
When I run `berks update not_real`
|
138
|
-
Then the output should contain:
|
139
|
-
"""
|
140
|
-
Dependency 'not_real' was not found. Please make sure it is in your Berksfile, and then run `berks install` to download and install the missing dependencies.
|
141
|
-
"""
|
142
|
-
And the exit status should be "DependencyNotFound"
|
@@ -1,426 +0,0 @@
|
|
1
|
-
Feature: berks upload
|
2
|
-
Background:
|
3
|
-
* the Chef Server is empty
|
4
|
-
* the cookbook store has the cookbooks:
|
5
|
-
| fake | 1.0.0 |
|
6
|
-
| ekaf | 2.0.0 |
|
7
|
-
| oops | 3.0.0 |
|
8
|
-
|
9
|
-
Scenario: multiple cookbooks with no arguments
|
10
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
11
|
-
"""
|
12
|
-
cookbook 'fake', '1.0.0'
|
13
|
-
cookbook 'ekaf', '2.0.0'
|
14
|
-
"""
|
15
|
-
And I write to "Berksfile.lock" with:
|
16
|
-
"""
|
17
|
-
DEPENDENCIES
|
18
|
-
fake (= 1.0.0)
|
19
|
-
ekaf (= 2.0.0)
|
20
|
-
|
21
|
-
GRAPH
|
22
|
-
fake (1.0.0)
|
23
|
-
ekaf (2.0.0)
|
24
|
-
"""
|
25
|
-
When I successfully run `berks upload`
|
26
|
-
Then the Chef Server should have the cookbooks:
|
27
|
-
| fake | 1.0.0 |
|
28
|
-
| ekaf | 2.0.0 |
|
29
|
-
|
30
|
-
Scenario: a cookbook with a path location
|
31
|
-
Given a cookbook named "fake"
|
32
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
33
|
-
"""
|
34
|
-
cookbook 'fake', path: './fake'
|
35
|
-
"""
|
36
|
-
And I write to "Berksfile.lock" with:
|
37
|
-
"""
|
38
|
-
DEPENDENCIES
|
39
|
-
fake
|
40
|
-
path: ./fake
|
41
|
-
|
42
|
-
GRAPH
|
43
|
-
fake (0.0.0)
|
44
|
-
"""
|
45
|
-
When I successfully run `berks upload`
|
46
|
-
Then the Chef Server should have the cookbooks:
|
47
|
-
| fake | 0.0.0 |
|
48
|
-
|
49
|
-
Scenario: specifying a single cookbook with dependencies
|
50
|
-
Given the cookbook store contains a cookbook "reset" "3.4.5" with dependencies:
|
51
|
-
| fake | = 1.0.0 |
|
52
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
53
|
-
"""
|
54
|
-
cookbook 'fake', '1.0.0'
|
55
|
-
cookbook 'ekaf', '2.0.0'
|
56
|
-
cookbook 'reset', '3.4.5'
|
57
|
-
"""
|
58
|
-
And I write to "Berksfile.lock" with:
|
59
|
-
"""
|
60
|
-
DEPENDENCIES
|
61
|
-
ekaf (= 2.0.0)
|
62
|
-
fake (= 1.0.0)
|
63
|
-
reset (= 3.4.5)
|
64
|
-
|
65
|
-
GRAPH
|
66
|
-
ekaf (2.0.0)
|
67
|
-
fake (1.0.0)
|
68
|
-
reset (3.4.5)
|
69
|
-
fake (= 1.0.0)
|
70
|
-
"""
|
71
|
-
When I successfully run `berks upload reset`
|
72
|
-
Then the Chef Server should have the cookbooks:
|
73
|
-
| reset | 3.4.5 |
|
74
|
-
And the Chef Server should not have the cookbooks:
|
75
|
-
| fake | 1.0.0 |
|
76
|
-
| ekaf | 2.0.0 |
|
77
|
-
|
78
|
-
Scenario: specifying a single cookbook that is a transitive dependency
|
79
|
-
Given the cookbook store contains a cookbook "reset" "3.4.5" with dependencies:
|
80
|
-
| fake | 1.0.0 |
|
81
|
-
| ekaf | 2.0.0 |
|
82
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
83
|
-
"""
|
84
|
-
cookbook 'reset', '3.4.5'
|
85
|
-
"""
|
86
|
-
And I write to "Berksfile.lock" with:
|
87
|
-
"""
|
88
|
-
DEPENDENCIES
|
89
|
-
reset (= 3.4.5)
|
90
|
-
|
91
|
-
GRAPH
|
92
|
-
ekaf (2.0.0)
|
93
|
-
fake (1.0.0)
|
94
|
-
reset (3.4.5)
|
95
|
-
ekaf (= 2.0.0)
|
96
|
-
fake (= 1.0.0)
|
97
|
-
"""
|
98
|
-
When I successfully run `berks upload fake`
|
99
|
-
Then the Chef Server should have the cookbooks:
|
100
|
-
| fake | 1.0.0 |
|
101
|
-
|
102
|
-
Scenario: specifying a dependency not defined in the Berksfile
|
103
|
-
Given I have a Berksfile pointing at the local Berkshelf API
|
104
|
-
And I write to "Berksfile.lock" with:
|
105
|
-
"""
|
106
|
-
DEPENDENCIES
|
107
|
-
fake (= 1.0.0)
|
108
|
-
|
109
|
-
GRAPH
|
110
|
-
fake (1.0.0)
|
111
|
-
"""
|
112
|
-
When I run `berks upload reset`
|
113
|
-
Then the output should contain:
|
114
|
-
"""
|
115
|
-
Dependency 'reset' was not found. Please make sure it is in your Berksfile, and then run `berks install` to download and install the missing dependencies.
|
116
|
-
"""
|
117
|
-
And the exit status should be "DependencyNotFound"
|
118
|
-
|
119
|
-
Scenario: specifying multiple cookbooks to upload
|
120
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
121
|
-
"""
|
122
|
-
cookbook 'fake', '1.0.0'
|
123
|
-
cookbook 'ekaf', '2.0.0'
|
124
|
-
cookbook 'oops', '3.0.0'
|
125
|
-
"""
|
126
|
-
And I write to "Berksfile.lock" with:
|
127
|
-
"""
|
128
|
-
DEPENDENCIES
|
129
|
-
ekaf (= 2.0.0)
|
130
|
-
fake (= 1.0.0)
|
131
|
-
oops (= 3.0.0)
|
132
|
-
|
133
|
-
GRAPH
|
134
|
-
ekaf (2.0.0)
|
135
|
-
fake (1.0.0)
|
136
|
-
oops (3.0.0)
|
137
|
-
"""
|
138
|
-
When I successfully run `berks upload fake ekaf`
|
139
|
-
Then the Chef Server should have the cookbooks:
|
140
|
-
| fake |
|
141
|
-
| ekaf |
|
142
|
-
And the Chef Server should not have the cookbooks:
|
143
|
-
| oops |
|
144
|
-
|
145
|
-
Scenario: uploading a filter does not change the lockfile
|
146
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
147
|
-
"""
|
148
|
-
cookbook 'fake', group: :take_me
|
149
|
-
cookbook 'ekaf', group: :not_me
|
150
|
-
"""
|
151
|
-
And I write to "Berksfile.lock" with:
|
152
|
-
"""
|
153
|
-
DEPENDENCIES
|
154
|
-
ekaf
|
155
|
-
fake
|
156
|
-
|
157
|
-
GRAPH
|
158
|
-
ekaf (2.0.0)
|
159
|
-
fake (1.0.0)
|
160
|
-
"""
|
161
|
-
When I run `berks upload --only take_me`
|
162
|
-
Then the file "Berksfile.lock" should contain:
|
163
|
-
"""
|
164
|
-
DEPENDENCIES
|
165
|
-
ekaf
|
166
|
-
fake
|
167
|
-
|
168
|
-
GRAPH
|
169
|
-
ekaf (2.0.0)
|
170
|
-
fake (1.0.0)
|
171
|
-
"""
|
172
|
-
|
173
|
-
Scenario: uploading a single groups of demands with the --only flag
|
174
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
175
|
-
"""
|
176
|
-
cookbook 'fake', group: :take_me
|
177
|
-
cookbook 'ekaf', group: :not_me
|
178
|
-
"""
|
179
|
-
And I write to "Berksfile.lock" with:
|
180
|
-
"""
|
181
|
-
DEPENDENCIES
|
182
|
-
ekaf
|
183
|
-
fake
|
184
|
-
|
185
|
-
GRAPH
|
186
|
-
ekaf (2.0.0)
|
187
|
-
fake (1.0.0)
|
188
|
-
"""
|
189
|
-
When I successfully run `berks upload --only take_me`
|
190
|
-
Then the Chef Server should have the cookbooks:
|
191
|
-
| fake | 1.0.0 |
|
192
|
-
And the Chef Server should not have the cookbooks:
|
193
|
-
| ekaf | 2.0.0 |
|
194
|
-
|
195
|
-
Scenario: uploading multiple groups of demands with the --only flag
|
196
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
197
|
-
"""
|
198
|
-
cookbook 'fake', group: :take_me
|
199
|
-
cookbook 'ekaf', group: :not_me
|
200
|
-
"""
|
201
|
-
And I write to "Berksfile.lock" with:
|
202
|
-
"""
|
203
|
-
DEPENDENCIES
|
204
|
-
ekaf
|
205
|
-
fake
|
206
|
-
|
207
|
-
GRAPH
|
208
|
-
ekaf (2.0.0)
|
209
|
-
fake (1.0.0)
|
210
|
-
"""
|
211
|
-
When I successfully run `berks upload --only take_me not_me`
|
212
|
-
And the Chef Server should have the cookbooks:
|
213
|
-
| fake | 1.0.0 |
|
214
|
-
| ekaf | 2.0.0 |
|
215
|
-
|
216
|
-
Scenario: skipping a single group to upload with the --except flag
|
217
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
218
|
-
"""
|
219
|
-
cookbook 'fake', group: :take_me
|
220
|
-
cookbook 'ekaf', group: :not_me
|
221
|
-
"""
|
222
|
-
And I write to "Berksfile.lock" with:
|
223
|
-
"""
|
224
|
-
DEPENDENCIES
|
225
|
-
ekaf
|
226
|
-
fake
|
227
|
-
|
228
|
-
GRAPH
|
229
|
-
ekaf (2.0.0)
|
230
|
-
fake (1.0.0)
|
231
|
-
"""
|
232
|
-
When I successfully run `berks upload --except not_me`
|
233
|
-
And the Chef Server should have the cookbooks:
|
234
|
-
| fake | 1.0.0 |
|
235
|
-
And the Chef Server should not have the cookbooks:
|
236
|
-
| ekaf | 2.0.0 |
|
237
|
-
|
238
|
-
Scenario: skipping multiple groups with the --except flag
|
239
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
240
|
-
"""
|
241
|
-
cookbook 'fake', group: :take_me
|
242
|
-
cookbook 'ekaf', group: :not_me
|
243
|
-
"""
|
244
|
-
And I write to "Berksfile.lock" with:
|
245
|
-
"""
|
246
|
-
DEPENDENCIES
|
247
|
-
ekaf
|
248
|
-
fake
|
249
|
-
|
250
|
-
GRAPH
|
251
|
-
ekaf (2.0.0)
|
252
|
-
fake (1.0.0)
|
253
|
-
"""
|
254
|
-
When I successfully run `berks upload --except take_me not_me`
|
255
|
-
And the Chef Server should not have the cookbooks:
|
256
|
-
| fake | 1.0.0 |
|
257
|
-
| ekaf | 2.0.0 |
|
258
|
-
|
259
|
-
Scenario: specifying cookbooks with transitive dependencies in a group
|
260
|
-
Given the cookbook store contains a cookbook "reset" "3.4.5" with dependencies:
|
261
|
-
| fake | 1.0.0 |
|
262
|
-
And the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
|
263
|
-
| ekaf | 2.0.0 |
|
264
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
265
|
-
"""
|
266
|
-
group :rockstars do
|
267
|
-
cookbook 'reset', '3.4.5'
|
268
|
-
end
|
269
|
-
|
270
|
-
group :losers do
|
271
|
-
cookbook 'seth', '1.0.0'
|
272
|
-
end
|
273
|
-
"""
|
274
|
-
And I write to "Berksfile.lock" with:
|
275
|
-
"""
|
276
|
-
DEPENDENCIES
|
277
|
-
reset (= 3.4.5)
|
278
|
-
|
279
|
-
GRAPH
|
280
|
-
ekaf (2.0.0)
|
281
|
-
fake (1.0.0)
|
282
|
-
ekaf (= 2.0.0)
|
283
|
-
reset (3.4.5)
|
284
|
-
fake (= 1.0.0)
|
285
|
-
"""
|
286
|
-
When I successfully run `berks upload --only rockstars`
|
287
|
-
Then the Chef Server should have the cookbooks:
|
288
|
-
| reset | 3.4.5 |
|
289
|
-
| fake | 1.0.0 |
|
290
|
-
| ekaf | 2.0.0 |
|
291
|
-
And the Chef Server should not have the cookbooks:
|
292
|
-
| seth | 1.0.0 |
|
293
|
-
|
294
|
-
Scenario: attempting to upload an invalid cookbook
|
295
|
-
Given a cookbook named "cookbook with spaces"
|
296
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
297
|
-
"""
|
298
|
-
cookbook 'cookbook with spaces', path: './cookbook with spaces'
|
299
|
-
"""
|
300
|
-
And I write to "Berksfile.lock" with:
|
301
|
-
"""
|
302
|
-
DEPENDENCIES
|
303
|
-
cookbook with spaces
|
304
|
-
path: ./cookbook with spaces
|
305
|
-
|
306
|
-
GRAPH
|
307
|
-
cookbook with spaces (0.0.0)
|
308
|
-
"""
|
309
|
-
When I run `berks upload`
|
310
|
-
Then the output should contain:
|
311
|
-
"""
|
312
|
-
The cookbook 'cookbook with spaces' has invalid filenames:
|
313
|
-
"""
|
314
|
-
And the exit status should be "InvalidCookbookFiles"
|
315
|
-
|
316
|
-
Scenario: With unicode characters
|
317
|
-
Given a cookbook named "fake"
|
318
|
-
And I cd to "fake"
|
319
|
-
And I write to "README.md" with:
|
320
|
-
"""
|
321
|
-
Jamié Wiñsor
|
322
|
-
赛斯瓦戈
|
323
|
-
Μιψηαελ Ιωευ
|
324
|
-
جوستين كامبل
|
325
|
-
"""
|
326
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
327
|
-
"""
|
328
|
-
metadata
|
329
|
-
"""
|
330
|
-
And I write to "Berksfile.lock" with:
|
331
|
-
"""
|
332
|
-
DEPENDENCIES
|
333
|
-
fake
|
334
|
-
path: .
|
335
|
-
metadata: true
|
336
|
-
|
337
|
-
GRAPH
|
338
|
-
fake (0.0.0)
|
339
|
-
"""
|
340
|
-
When I successfully run `berks upload fake`
|
341
|
-
Then the output should contain:
|
342
|
-
"""
|
343
|
-
Uploaded fake (0.0.0)
|
344
|
-
"""
|
345
|
-
|
346
|
-
Scenario: When the cookbook already exist
|
347
|
-
And the Chef Server has frozen cookbooks:
|
348
|
-
| fake | 1.0.0 |
|
349
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
350
|
-
"""
|
351
|
-
cookbook 'fake', '1.0.0'
|
352
|
-
"""
|
353
|
-
And I write to "Berksfile.lock" with:
|
354
|
-
"""
|
355
|
-
DEPENDENCIES
|
356
|
-
fake (= 1.0.0)
|
357
|
-
|
358
|
-
GRAPH
|
359
|
-
fake (1.0.0)
|
360
|
-
"""
|
361
|
-
When I successfully run `berks upload`
|
362
|
-
Then the output should contain:
|
363
|
-
"""
|
364
|
-
Skipping fake (1.0.0) (frozen)
|
365
|
-
"""
|
366
|
-
|
367
|
-
Scenario: When the cookbook already exist and is a metadata location
|
368
|
-
Given a cookbook named "fake"
|
369
|
-
And the cookbook "fake" has the file "Berksfile" with:
|
370
|
-
"""
|
371
|
-
metadata
|
372
|
-
"""
|
373
|
-
And I cd to "fake"
|
374
|
-
And I write to "Berksfile.lock" with:
|
375
|
-
"""
|
376
|
-
DEPENDENCIES
|
377
|
-
fake
|
378
|
-
path: .
|
379
|
-
metadata: true
|
380
|
-
|
381
|
-
GRAPH
|
382
|
-
fake (0.0.0)
|
383
|
-
"""
|
384
|
-
And the Chef Server has frozen cookbooks:
|
385
|
-
| fake | 0.0.0 |
|
386
|
-
When I successfully run `berks upload`
|
387
|
-
Then the output should contain:
|
388
|
-
"""
|
389
|
-
Skipping fake (0.0.0) (frozen)
|
390
|
-
"""
|
391
|
-
|
392
|
-
Scenario: When the syntax check is skipped
|
393
|
-
Given a cookbook named "fake"
|
394
|
-
And the cookbook "fake" has the file "recipes/default.rb" with:
|
395
|
-
"""
|
396
|
-
Totally not valid Ruby syntax
|
397
|
-
"""
|
398
|
-
And the cookbook "fake" has the file "templates/default/file.erb" with:
|
399
|
-
"""
|
400
|
-
<% for %>
|
401
|
-
"""
|
402
|
-
And the cookbook "fake" has the file "recipes/template.rb" with:
|
403
|
-
"""
|
404
|
-
template "/tmp/wadus" do
|
405
|
-
source "file.erb"
|
406
|
-
end
|
407
|
-
"""
|
408
|
-
And the cookbook "fake" has the file "Berksfile" with:
|
409
|
-
"""
|
410
|
-
source 'https://supermarket.chef.io'
|
411
|
-
metadata
|
412
|
-
"""
|
413
|
-
And the cookbook "fake" has the file "Berksfile.lock" with:
|
414
|
-
"""
|
415
|
-
DEPENDENCIES
|
416
|
-
fake
|
417
|
-
path: .
|
418
|
-
metadata: true
|
419
|
-
|
420
|
-
GRAPH
|
421
|
-
fake (0.0.0)
|
422
|
-
"""
|
423
|
-
And I cd to "fake"
|
424
|
-
When I successfully run `berks upload --skip-syntax-check`
|
425
|
-
Then the Chef Server should have the cookbooks:
|
426
|
-
| fake | 0.0.0 |
|
@@ -1,111 +0,0 @@
|
|
1
|
-
Feature: Vendoring cookbooks to a directory
|
2
|
-
Background:
|
3
|
-
* the Berkshelf API server's cache is empty
|
4
|
-
* the Chef Server has cookbooks:
|
5
|
-
| fake | 1.0.0 |
|
6
|
-
| ekaf | 2.0.0 |
|
7
|
-
* the Berkshelf API server's cache is up to date
|
8
|
-
|
9
|
-
Scenario: successfully vendoring a Berksfile with multiple cookbook demands
|
10
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
11
|
-
"""
|
12
|
-
cookbook 'fake'
|
13
|
-
cookbook 'ekaf'
|
14
|
-
"""
|
15
|
-
When I successfully run `berks vendor cukebooks`
|
16
|
-
Then the directory "cukebooks/fake" should contain version "1.0.0" of the "fake" cookbook
|
17
|
-
And the directory "cukebooks/ekaf" should contain version "2.0.0" of the "ekaf" cookbook
|
18
|
-
|
19
|
-
Scenario: attempting to vendor when no Berksfile is present
|
20
|
-
When I run `berks vendor cukebooks`
|
21
|
-
Then the exit status should be "BerksfileNotFound"
|
22
|
-
|
23
|
-
Scenario: vendoring a Berksfile with a metadata demand
|
24
|
-
Given a cookbook named "fake"
|
25
|
-
And I cd to "fake"
|
26
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
27
|
-
"""
|
28
|
-
metadata
|
29
|
-
"""
|
30
|
-
When I successfully run `berks vendor cukebooks`
|
31
|
-
Then the directory "cukebooks/fake" should contain version "0.0.0" of the "fake" cookbook
|
32
|
-
|
33
|
-
Scenario: vendoring a cookbook with transitive dependencies
|
34
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
35
|
-
"""
|
36
|
-
metadata
|
37
|
-
"""
|
38
|
-
And I write to "metadata.rb" with:
|
39
|
-
"""
|
40
|
-
name 'bacon'
|
41
|
-
version '1.0.0'
|
42
|
-
|
43
|
-
depends 'fake'
|
44
|
-
depends 'ekaf'
|
45
|
-
"""
|
46
|
-
When I successfully run `berks vendor vendor`
|
47
|
-
Then the directory "vendor/bacon" should contain version "1.0.0" of the "bacon" cookbook
|
48
|
-
And the directory "vendor/fake" should contain version "1.0.0" of the "fake" cookbook
|
49
|
-
And the directory "vendor/ekaf" should contain version "2.0.0" of the "ekaf" cookbook
|
50
|
-
|
51
|
-
Scenario: vendoring a cookbook with transitive dependencies when a lockfile is present
|
52
|
-
Given a cookbook named "bacon"
|
53
|
-
And the cookbook "bacon" has the file "metadata.rb" with:
|
54
|
-
"""
|
55
|
-
name 'bacon'
|
56
|
-
version '1.0.0'
|
57
|
-
|
58
|
-
depends 'fake'
|
59
|
-
depends 'ekaf'
|
60
|
-
"""
|
61
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
62
|
-
"""
|
63
|
-
cookbook 'bacon', path: './bacon'
|
64
|
-
"""
|
65
|
-
And I write to "Berksfile.lock" with:
|
66
|
-
"""
|
67
|
-
DEPENDENCIES
|
68
|
-
bacon
|
69
|
-
path: ./bacon
|
70
|
-
|
71
|
-
GRAPH
|
72
|
-
bacon (1.0.0)
|
73
|
-
ekaf (>= 0.0.0)
|
74
|
-
fake (>= 0.0.0)
|
75
|
-
ekaf (2.0.0)
|
76
|
-
fake (1.0.0)
|
77
|
-
"""
|
78
|
-
When I successfully run `berks vendor vendor`
|
79
|
-
Then the directory "vendor/bacon" should contain version "1.0.0" of the "bacon" cookbook
|
80
|
-
And the directory "vendor/fake" should contain version "1.0.0" of the "fake" cookbook
|
81
|
-
And the directory "vendor/ekaf" should contain version "2.0.0" of the "ekaf" cookbook
|
82
|
-
|
83
|
-
Scenario: vendoring without an explicit path to vendor into
|
84
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
85
|
-
"""
|
86
|
-
cookbook 'fake'
|
87
|
-
"""
|
88
|
-
When I successfully run `berks vendor`
|
89
|
-
Then the directory "berks-cookbooks/fake" should contain version "1.0.0" of the "fake" cookbook
|
90
|
-
|
91
|
-
Scenario: vendoring to a directory that already exists
|
92
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
93
|
-
"""
|
94
|
-
cookbook 'fake'
|
95
|
-
"""
|
96
|
-
And a directory named "cukebooks"
|
97
|
-
And a directory named "cukebooks/fake/ponies"
|
98
|
-
And a directory named "cukebooks/existing_cookbook"
|
99
|
-
When I successfully run `berks vendor --delete cukebooks`
|
100
|
-
Then the directory "cukebooks/fake" should contain version "1.0.0" of the "fake" cookbook
|
101
|
-
And a directory named "cukebooks/fake/ponies" should not exist
|
102
|
-
And a directory named "cukebooks/existing_cookbook" should not exist
|
103
|
-
|
104
|
-
Scenario: vendoring into a nested directory
|
105
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
106
|
-
"""
|
107
|
-
cookbook 'fake'
|
108
|
-
"""
|
109
|
-
When I successfully run `berks vendor path/to/cukebooks`
|
110
|
-
Then the directory "path/to/cukebooks/fake" should contain version "1.0.0" of the "fake" cookbook
|
111
|
-
|
@@ -1,29 +0,0 @@
|
|
1
|
-
Feature: berks verify
|
2
|
-
Scenario: running verify when there is no Lockfile present
|
3
|
-
Given a cookbook named "sparkle_motion"
|
4
|
-
And I cd to "sparkle_motion"
|
5
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
6
|
-
"""
|
7
|
-
metadata
|
8
|
-
"""
|
9
|
-
And I run `berks verify`
|
10
|
-
Then the output should contain:
|
11
|
-
"""
|
12
|
-
Lockfile not found! Run `berks install` to create the lockfile.
|
13
|
-
"""
|
14
|
-
And the exit status should be "LockfileNotFound"
|
15
|
-
|
16
|
-
Scenario: running verify when there is a valid Lockfile present
|
17
|
-
Given a cookbook named "sparkle_motion"
|
18
|
-
And I cd to "sparkle_motion"
|
19
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
20
|
-
"""
|
21
|
-
metadata
|
22
|
-
"""
|
23
|
-
When I successfully run `berks install`
|
24
|
-
And I successfully run `berks verify`
|
25
|
-
Then the output should contain:
|
26
|
-
"""
|
27
|
-
Verifying (1) cookbook(s)...
|
28
|
-
Verified.
|
29
|
-
"""
|