berkshelf 7.0.6 → 7.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +7 -7
- data/Rakefile +2 -2
- data/berkshelf.gemspec +9 -10
- data/bin/berks +5 -0
- data/lib/berkshelf.rb +2 -2
- data/lib/berkshelf/api_client/chef_server_connection.rb +3 -2
- data/lib/berkshelf/api_client/connection.rb +1 -1
- data/lib/berkshelf/berksfile.rb +47 -41
- data/lib/berkshelf/cached_cookbook.rb +6 -4
- data/lib/berkshelf/chef_config_compat.rb +1 -0
- data/lib/berkshelf/chef_repo_universe.rb +6 -4
- data/lib/berkshelf/cli.rb +12 -7
- data/lib/berkshelf/commands/shelf.rb +1 -1
- data/lib/berkshelf/community_rest.rb +4 -4
- data/lib/berkshelf/config.rb +1 -1
- data/lib/berkshelf/core_ext.rb +1 -1
- data/lib/berkshelf/core_ext/file_utils.rb +2 -2
- data/lib/berkshelf/dependency.rb +1 -1
- data/lib/berkshelf/downloader.rb +10 -3
- data/lib/berkshelf/errors.rb +2 -2
- data/lib/berkshelf/formatters/human.rb +1 -1
- data/lib/berkshelf/formatters/json.rb +4 -4
- data/lib/berkshelf/installer.rb +1 -1
- data/lib/berkshelf/location.rb +3 -3
- data/lib/berkshelf/lockfile.rb +14 -14
- data/lib/berkshelf/logger.rb +4 -2
- data/lib/berkshelf/mixin/git.rb +1 -1
- data/lib/berkshelf/packager.rb +2 -2
- data/lib/berkshelf/resolver.rb +1 -1
- data/lib/berkshelf/ridley_compat.rb +1 -1
- data/lib/berkshelf/shell.rb +1 -0
- data/lib/berkshelf/source.rb +6 -5
- data/lib/berkshelf/ssl_policies.rb +1 -3
- data/lib/berkshelf/thor.rb +1 -1
- data/lib/berkshelf/thor_ext.rb +1 -1
- data/lib/berkshelf/uploader.rb +11 -9
- data/lib/berkshelf/version.rb +1 -1
- data/lib/berkshelf/visualizer.rb +1 -1
- data/spec/config/knife.rb +1 -1
- data/spec/support/chef_server.rb +2 -2
- data/spec/support/git.rb +18 -18
- data/spec/support/path_helpers.rb +4 -4
- data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/attributes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/files/default/file.h +0 -0
- data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/metadata.rb +2 -0
- data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/recipes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/dep-1.0.0/templates/default/template.erb +0 -0
- data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/attributes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/files/default/file.h +0 -0
- data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/metadata.rb +3 -0
- data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.0/recipes/default.rb +0 -0
- data/spec/tmp/berkshelf/cookbooks/ekaf-1.0.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 +3 -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 +7 -7
- data/spec/unit/berkshelf/cli_spec.rb +1 -2
- data/spec/unit/berkshelf/community_rest_spec.rb +1 -1
- data/spec/unit/berkshelf/core_ext/file_utils_spec.rb +2 -2
- data/spec/unit/berkshelf/dependency_spec.rb +5 -5
- data/spec/unit/berkshelf/downloader_spec.rb +29 -8
- data/spec/unit/berkshelf/locations/base_spec.rb +1 -2
- data/spec/unit/berkshelf/locations/path_spec.rb +1 -2
- data/spec/unit/berkshelf/lockfile_spec.rb +9 -18
- data/spec/unit/berkshelf/ridley_compat_spec.rb +1 -1
- data/spec/unit/berkshelf/source_spec.rb +8 -7
- data/spec/unit/berkshelf/ssl_policies_spec.rb +3 -5
- data/spec/unit/berkshelf/uploader_spec.rb +6 -10
- metadata +49 -188
- data/.github/lock.yml +0 -1
- data/.gitignore +0 -30
- data/.rubocop.yml +0 -12
- data/.travis.yml +0 -73
- data/CHANGELOG.legacy.md +0 -307
- data/CHANGELOG.md +0 -1582
- data/CONTRIBUTING.md +0 -68
- data/Gemfile.lock +0 -301
- data/PLUGINS.md +0 -25
- data/README.md +0 -72
- data/Thorfile +0 -61
- data/appveyor.yml +0 -31
- data/docs/berkshelf_for_newcomers.md +0 -64
- data/features/artifactory.feature +0 -70
- data/features/berksfile.feature +0 -46
- data/features/commands/apply.feature +0 -41
- data/features/commands/contingent.feature +0 -47
- data/features/commands/info.feature +0 -141
- data/features/commands/install.feature +0 -646
- data/features/commands/list.feature +0 -78
- data/features/commands/outdated.feature +0 -127
- 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 -113
- 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 -499
- data/features/commands/vendor.feature +0 -154
- data/features/commands/verify.feature +0 -29
- data/features/commands/viz.feature +0 -66
- data/features/community_site.feature +0 -37
- data/features/help.feature +0 -11
- data/features/json_formatter.feature +0 -158
- data/features/lifecycle.feature +0 -378
- data/features/lockfile.feature +0 -378
- data/features/step_definitions/berksfile_steps.rb +0 -54
- 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 -11
- data/features/step_definitions/filesystem_steps.rb +0 -286
- data/features/step_definitions/gem_steps.rb +0 -13
- data/features/step_definitions/json_steps.rb +0 -29
- data/features/step_definitions/utility_steps.rb +0 -11
- data/features/support/aruba.rb +0 -12
- data/features/support/env.rb +0 -77
- data/spec/fixtures/cookbooks/example_cookbook/.gitignore +0 -2
- data/spec/fixtures/cookbooks/example_cookbook/.kitchen.yml +0 -26
@@ -1,83 +0,0 @@
|
|
1
|
-
Feature: berks show
|
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 show fake`
|
18
|
-
Then the output should contain "cookbooks/fake-1.0.0"
|
19
|
-
|
20
|
-
Scenario: When the parameter is a transitive dependency
|
21
|
-
Given the cookbook store has the cookbooks:
|
22
|
-
| dep | 1.0.0 |
|
23
|
-
And the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
|
24
|
-
| dep | ~> 1.0.0 |
|
25
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
26
|
-
"""
|
27
|
-
cookbook 'fake', '1.0.0'
|
28
|
-
"""
|
29
|
-
And I write to "Berksfile.lock" with:
|
30
|
-
"""
|
31
|
-
DEPENDENCIES
|
32
|
-
fake (= 1.0.0)
|
33
|
-
|
34
|
-
GRAPH
|
35
|
-
dep (1.0.0)
|
36
|
-
fake (1.0.0)
|
37
|
-
dep (~> 1.0.0)
|
38
|
-
"""
|
39
|
-
And I successfully run `berks install`
|
40
|
-
When I successfully run `berks show dep`
|
41
|
-
Then the output should contain "cookbooks/dep-1.0.0"
|
42
|
-
|
43
|
-
Scenario: When the cookbook is not in the Berksfile
|
44
|
-
Given I have a Berksfile pointing at the local Berkshelf API
|
45
|
-
When I run `berks show fake`
|
46
|
-
Then the output should contain:
|
47
|
-
"""
|
48
|
-
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.
|
49
|
-
"""
|
50
|
-
And the exit status should be "DependencyNotFound"
|
51
|
-
|
52
|
-
Scenario: When there is no lockfile present
|
53
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
54
|
-
"""
|
55
|
-
cookbook 'fake', '1.0.0'
|
56
|
-
"""
|
57
|
-
When I run `berks show fake`
|
58
|
-
Then the output should contain:
|
59
|
-
"""
|
60
|
-
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.
|
61
|
-
"""
|
62
|
-
And the exit status should be "DependencyNotFound"
|
63
|
-
|
64
|
-
Scenario: When the cookbook is not installed
|
65
|
-
Given the cookbook store is empty
|
66
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
67
|
-
"""
|
68
|
-
cookbook 'fake', '1.0.0'
|
69
|
-
"""
|
70
|
-
And I write to "Berksfile.lock" with:
|
71
|
-
"""
|
72
|
-
DEPENDENCIES
|
73
|
-
fake (= 1.0.0)
|
74
|
-
|
75
|
-
GRAPH
|
76
|
-
fake (1.0.0)
|
77
|
-
"""
|
78
|
-
When I run `berks show fake`
|
79
|
-
Then the output should contain:
|
80
|
-
"""
|
81
|
-
Cookbook 'fake' (1.0.0) not found in the cookbook store!
|
82
|
-
"""
|
83
|
-
And the exit status should be "CookbookNotFound"
|
@@ -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,499 +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 without metadata.json
|
31
|
-
Given a cookbook named "fake"
|
32
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
33
|
-
"""
|
34
|
-
metadata
|
35
|
-
"""
|
36
|
-
And I write to "metadata.rb" with:
|
37
|
-
"""
|
38
|
-
name 'bacon'
|
39
|
-
version '1.0.0'
|
40
|
-
"""
|
41
|
-
When I successfully run `berks install`
|
42
|
-
And I successfully run `berks upload`
|
43
|
-
Then the Chef Server should have the cookbooks:
|
44
|
-
| bacon | 1.0.0 |
|
45
|
-
And a file named "metadata.json" should not exist
|
46
|
-
|
47
|
-
Scenario: a cookbook with metadata.json
|
48
|
-
Given a cookbook named "fake"
|
49
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
50
|
-
"""
|
51
|
-
metadata
|
52
|
-
"""
|
53
|
-
And I write to "metadata.rb" with:
|
54
|
-
"""
|
55
|
-
name 'bacon'
|
56
|
-
version '1.0.0'
|
57
|
-
"""
|
58
|
-
And I write to "metadata.json" with:
|
59
|
-
"""
|
60
|
-
{
|
61
|
-
"name": "bacon",
|
62
|
-
"description": "",
|
63
|
-
"long_description": "",
|
64
|
-
"maintainer": "",
|
65
|
-
"maintainer_email": "",
|
66
|
-
"license": "All rights reserved",
|
67
|
-
"platforms": {
|
68
|
-
|
69
|
-
},
|
70
|
-
"dependencies": {
|
71
|
-
|
72
|
-
},
|
73
|
-
"providing": {
|
74
|
-
|
75
|
-
},
|
76
|
-
"attributes": {
|
77
|
-
|
78
|
-
},
|
79
|
-
"recipes": {
|
80
|
-
|
81
|
-
},
|
82
|
-
"version": "1.0.0",
|
83
|
-
"source_url": "",
|
84
|
-
"issues_url": "",
|
85
|
-
"privacy": false,
|
86
|
-
"chef_versions": [
|
87
|
-
|
88
|
-
],
|
89
|
-
"ohai_versions": [
|
90
|
-
|
91
|
-
],
|
92
|
-
"gems": [
|
93
|
-
|
94
|
-
]
|
95
|
-
}
|
96
|
-
"""
|
97
|
-
When I successfully run `berks install`
|
98
|
-
And I successfully run `berks upload`
|
99
|
-
Then the Chef Server should have the cookbooks:
|
100
|
-
| bacon | 1.0.0 |
|
101
|
-
And a file named "metadata.json" should exist
|
102
|
-
|
103
|
-
Scenario: a cookbook with a path location
|
104
|
-
Given a cookbook named "fake"
|
105
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
106
|
-
"""
|
107
|
-
cookbook 'fake', path: './fake'
|
108
|
-
"""
|
109
|
-
And I write to "Berksfile.lock" with:
|
110
|
-
"""
|
111
|
-
DEPENDENCIES
|
112
|
-
fake
|
113
|
-
path: ./fake
|
114
|
-
|
115
|
-
GRAPH
|
116
|
-
fake (0.0.0)
|
117
|
-
"""
|
118
|
-
When I successfully run `berks upload`
|
119
|
-
Then the Chef Server should have the cookbooks:
|
120
|
-
| fake | 0.0.0 |
|
121
|
-
|
122
|
-
Scenario: specifying a single cookbook with dependencies
|
123
|
-
Given the cookbook store contains a cookbook "reset" "3.4.5" with dependencies:
|
124
|
-
| fake | = 1.0.0 |
|
125
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
126
|
-
"""
|
127
|
-
cookbook 'fake', '1.0.0'
|
128
|
-
cookbook 'ekaf', '2.0.0'
|
129
|
-
cookbook 'reset', '3.4.5'
|
130
|
-
"""
|
131
|
-
And I write to "Berksfile.lock" with:
|
132
|
-
"""
|
133
|
-
DEPENDENCIES
|
134
|
-
ekaf (= 2.0.0)
|
135
|
-
fake (= 1.0.0)
|
136
|
-
reset (= 3.4.5)
|
137
|
-
|
138
|
-
GRAPH
|
139
|
-
ekaf (2.0.0)
|
140
|
-
fake (1.0.0)
|
141
|
-
reset (3.4.5)
|
142
|
-
fake (= 1.0.0)
|
143
|
-
"""
|
144
|
-
When I successfully run `berks upload reset`
|
145
|
-
Then the Chef Server should have the cookbooks:
|
146
|
-
| reset | 3.4.5 |
|
147
|
-
And the Chef Server should not have the cookbooks:
|
148
|
-
| fake | 1.0.0 |
|
149
|
-
| ekaf | 2.0.0 |
|
150
|
-
|
151
|
-
Scenario: specifying a single cookbook that is a transitive dependency
|
152
|
-
Given the cookbook store contains a cookbook "reset" "3.4.5" with dependencies:
|
153
|
-
| fake | 1.0.0 |
|
154
|
-
| ekaf | 2.0.0 |
|
155
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
156
|
-
"""
|
157
|
-
cookbook 'reset', '3.4.5'
|
158
|
-
"""
|
159
|
-
And I write to "Berksfile.lock" with:
|
160
|
-
"""
|
161
|
-
DEPENDENCIES
|
162
|
-
reset (= 3.4.5)
|
163
|
-
|
164
|
-
GRAPH
|
165
|
-
ekaf (2.0.0)
|
166
|
-
fake (1.0.0)
|
167
|
-
reset (3.4.5)
|
168
|
-
ekaf (= 2.0.0)
|
169
|
-
fake (= 1.0.0)
|
170
|
-
"""
|
171
|
-
When I successfully run `berks upload fake`
|
172
|
-
Then the Chef Server should have the cookbooks:
|
173
|
-
| fake | 1.0.0 |
|
174
|
-
|
175
|
-
Scenario: specifying a dependency not defined in the Berksfile
|
176
|
-
Given I have a Berksfile pointing at the local Berkshelf API
|
177
|
-
And I write to "Berksfile.lock" with:
|
178
|
-
"""
|
179
|
-
DEPENDENCIES
|
180
|
-
fake (= 1.0.0)
|
181
|
-
|
182
|
-
GRAPH
|
183
|
-
fake (1.0.0)
|
184
|
-
"""
|
185
|
-
When I run `berks upload reset`
|
186
|
-
Then the output should contain:
|
187
|
-
"""
|
188
|
-
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.
|
189
|
-
"""
|
190
|
-
And the exit status should be "DependencyNotFound"
|
191
|
-
|
192
|
-
Scenario: specifying multiple cookbooks to upload
|
193
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
194
|
-
"""
|
195
|
-
cookbook 'fake', '1.0.0'
|
196
|
-
cookbook 'ekaf', '2.0.0'
|
197
|
-
cookbook 'oops', '3.0.0'
|
198
|
-
"""
|
199
|
-
And I write to "Berksfile.lock" with:
|
200
|
-
"""
|
201
|
-
DEPENDENCIES
|
202
|
-
ekaf (= 2.0.0)
|
203
|
-
fake (= 1.0.0)
|
204
|
-
oops (= 3.0.0)
|
205
|
-
|
206
|
-
GRAPH
|
207
|
-
ekaf (2.0.0)
|
208
|
-
fake (1.0.0)
|
209
|
-
oops (3.0.0)
|
210
|
-
"""
|
211
|
-
When I successfully run `berks upload fake ekaf`
|
212
|
-
Then the Chef Server should have the cookbooks:
|
213
|
-
| fake |
|
214
|
-
| ekaf |
|
215
|
-
And the Chef Server should not have the cookbooks:
|
216
|
-
| oops |
|
217
|
-
|
218
|
-
Scenario: uploading a filter does not change the lockfile
|
219
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
220
|
-
"""
|
221
|
-
cookbook 'fake', group: :take_me
|
222
|
-
cookbook 'ekaf', group: :not_me
|
223
|
-
"""
|
224
|
-
And I write to "Berksfile.lock" with:
|
225
|
-
"""
|
226
|
-
DEPENDENCIES
|
227
|
-
ekaf
|
228
|
-
fake
|
229
|
-
|
230
|
-
GRAPH
|
231
|
-
ekaf (2.0.0)
|
232
|
-
fake (1.0.0)
|
233
|
-
"""
|
234
|
-
When I run `berks upload --only take_me`
|
235
|
-
Then the file "Berksfile.lock" should contain:
|
236
|
-
"""
|
237
|
-
DEPENDENCIES
|
238
|
-
ekaf
|
239
|
-
fake
|
240
|
-
|
241
|
-
GRAPH
|
242
|
-
ekaf (2.0.0)
|
243
|
-
fake (1.0.0)
|
244
|
-
"""
|
245
|
-
|
246
|
-
Scenario: uploading a single groups of demands with the --only flag
|
247
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
248
|
-
"""
|
249
|
-
cookbook 'fake', group: :take_me
|
250
|
-
cookbook 'ekaf', group: :not_me
|
251
|
-
"""
|
252
|
-
And I write to "Berksfile.lock" with:
|
253
|
-
"""
|
254
|
-
DEPENDENCIES
|
255
|
-
ekaf
|
256
|
-
fake
|
257
|
-
|
258
|
-
GRAPH
|
259
|
-
ekaf (2.0.0)
|
260
|
-
fake (1.0.0)
|
261
|
-
"""
|
262
|
-
When I successfully run `berks upload --only take_me`
|
263
|
-
Then the Chef Server should have the cookbooks:
|
264
|
-
| fake | 1.0.0 |
|
265
|
-
And the Chef Server should not have the cookbooks:
|
266
|
-
| ekaf | 2.0.0 |
|
267
|
-
|
268
|
-
Scenario: uploading multiple groups of demands with the --only flag
|
269
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
270
|
-
"""
|
271
|
-
cookbook 'fake', group: :take_me
|
272
|
-
cookbook 'ekaf', group: :not_me
|
273
|
-
"""
|
274
|
-
And I write to "Berksfile.lock" with:
|
275
|
-
"""
|
276
|
-
DEPENDENCIES
|
277
|
-
ekaf
|
278
|
-
fake
|
279
|
-
|
280
|
-
GRAPH
|
281
|
-
ekaf (2.0.0)
|
282
|
-
fake (1.0.0)
|
283
|
-
"""
|
284
|
-
When I successfully run `berks upload --only take_me not_me`
|
285
|
-
And the Chef Server should have the cookbooks:
|
286
|
-
| fake | 1.0.0 |
|
287
|
-
| ekaf | 2.0.0 |
|
288
|
-
|
289
|
-
Scenario: skipping a single group to upload with the --except flag
|
290
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
291
|
-
"""
|
292
|
-
cookbook 'fake', group: :take_me
|
293
|
-
cookbook 'ekaf', group: :not_me
|
294
|
-
"""
|
295
|
-
And I write to "Berksfile.lock" with:
|
296
|
-
"""
|
297
|
-
DEPENDENCIES
|
298
|
-
ekaf
|
299
|
-
fake
|
300
|
-
|
301
|
-
GRAPH
|
302
|
-
ekaf (2.0.0)
|
303
|
-
fake (1.0.0)
|
304
|
-
"""
|
305
|
-
When I successfully run `berks upload --except not_me`
|
306
|
-
And the Chef Server should have the cookbooks:
|
307
|
-
| fake | 1.0.0 |
|
308
|
-
And the Chef Server should not have the cookbooks:
|
309
|
-
| ekaf | 2.0.0 |
|
310
|
-
|
311
|
-
Scenario: skipping multiple groups with the --except flag
|
312
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
313
|
-
"""
|
314
|
-
cookbook 'fake', group: :take_me
|
315
|
-
cookbook 'ekaf', group: :not_me
|
316
|
-
"""
|
317
|
-
And I write to "Berksfile.lock" with:
|
318
|
-
"""
|
319
|
-
DEPENDENCIES
|
320
|
-
ekaf
|
321
|
-
fake
|
322
|
-
|
323
|
-
GRAPH
|
324
|
-
ekaf (2.0.0)
|
325
|
-
fake (1.0.0)
|
326
|
-
"""
|
327
|
-
When I successfully run `berks upload --except take_me not_me`
|
328
|
-
And the Chef Server should not have the cookbooks:
|
329
|
-
| fake | 1.0.0 |
|
330
|
-
| ekaf | 2.0.0 |
|
331
|
-
|
332
|
-
Scenario: specifying cookbooks with transitive dependencies in a group
|
333
|
-
Given the cookbook store contains a cookbook "reset" "3.4.5" with dependencies:
|
334
|
-
| fake | 1.0.0 |
|
335
|
-
And the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
|
336
|
-
| ekaf | 2.0.0 |
|
337
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
338
|
-
"""
|
339
|
-
group :rockstars do
|
340
|
-
cookbook 'reset', '3.4.5'
|
341
|
-
end
|
342
|
-
|
343
|
-
group :losers do
|
344
|
-
cookbook 'seth', '1.0.0'
|
345
|
-
end
|
346
|
-
"""
|
347
|
-
And I write to "Berksfile.lock" with:
|
348
|
-
"""
|
349
|
-
DEPENDENCIES
|
350
|
-
reset (= 3.4.5)
|
351
|
-
|
352
|
-
GRAPH
|
353
|
-
ekaf (2.0.0)
|
354
|
-
fake (1.0.0)
|
355
|
-
ekaf (= 2.0.0)
|
356
|
-
reset (3.4.5)
|
357
|
-
fake (= 1.0.0)
|
358
|
-
"""
|
359
|
-
When I successfully run `berks upload --only rockstars`
|
360
|
-
Then the Chef Server should have the cookbooks:
|
361
|
-
| reset | 3.4.5 |
|
362
|
-
| fake | 1.0.0 |
|
363
|
-
| ekaf | 2.0.0 |
|
364
|
-
And the Chef Server should not have the cookbooks:
|
365
|
-
| seth | 1.0.0 |
|
366
|
-
|
367
|
-
Scenario: attempting to upload an invalid cookbook
|
368
|
-
Given a cookbook named "cookbook with spaces"
|
369
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
370
|
-
"""
|
371
|
-
cookbook 'cookbook with spaces', path: './cookbook with spaces'
|
372
|
-
"""
|
373
|
-
And I write to "Berksfile.lock" with:
|
374
|
-
"""
|
375
|
-
DEPENDENCIES
|
376
|
-
cookbook with spaces
|
377
|
-
path: ./cookbook with spaces
|
378
|
-
|
379
|
-
GRAPH
|
380
|
-
cookbook with spaces (0.0.0)
|
381
|
-
"""
|
382
|
-
When I run `berks upload`
|
383
|
-
Then the output should contain:
|
384
|
-
"""
|
385
|
-
The cookbook 'cookbook with spaces' has invalid filenames:
|
386
|
-
"""
|
387
|
-
And the exit status should be "InvalidCookbookFiles"
|
388
|
-
|
389
|
-
Scenario: With unicode characters
|
390
|
-
Given a cookbook named "fake"
|
391
|
-
And I cd to "fake"
|
392
|
-
And I write to "README.md" with:
|
393
|
-
"""
|
394
|
-
Jamié Wiñsor
|
395
|
-
赛斯瓦戈
|
396
|
-
Μιψηαελ Ιωευ
|
397
|
-
جوستين كامبل
|
398
|
-
"""
|
399
|
-
And I have a Berksfile pointing at the local Berkshelf API with:
|
400
|
-
"""
|
401
|
-
metadata
|
402
|
-
"""
|
403
|
-
And I write to "Berksfile.lock" with:
|
404
|
-
"""
|
405
|
-
DEPENDENCIES
|
406
|
-
fake
|
407
|
-
path: .
|
408
|
-
metadata: true
|
409
|
-
|
410
|
-
GRAPH
|
411
|
-
fake (0.0.0)
|
412
|
-
"""
|
413
|
-
When I successfully run `berks upload fake`
|
414
|
-
Then the output should contain:
|
415
|
-
"""
|
416
|
-
Uploaded fake (0.0.0)
|
417
|
-
"""
|
418
|
-
|
419
|
-
Scenario: When the cookbook already exist
|
420
|
-
And the Chef Server has frozen cookbooks:
|
421
|
-
| fake | 1.0.0 |
|
422
|
-
Given I have a Berksfile pointing at the local Berkshelf API with:
|
423
|
-
"""
|
424
|
-
cookbook 'fake', '1.0.0'
|
425
|
-
"""
|
426
|
-
And I write to "Berksfile.lock" with:
|
427
|
-
"""
|
428
|
-
DEPENDENCIES
|
429
|
-
fake (= 1.0.0)
|
430
|
-
|
431
|
-
GRAPH
|
432
|
-
fake (1.0.0)
|
433
|
-
"""
|
434
|
-
When I successfully run `berks upload`
|
435
|
-
Then the output should contain:
|
436
|
-
"""
|
437
|
-
Skipping fake (1.0.0) (frozen)
|
438
|
-
"""
|
439
|
-
|
440
|
-
Scenario: When the cookbook already exist and is a metadata location
|
441
|
-
Given a cookbook named "fake"
|
442
|
-
And the cookbook "fake" has the file "Berksfile" with:
|
443
|
-
"""
|
444
|
-
metadata
|
445
|
-
"""
|
446
|
-
And I cd to "fake"
|
447
|
-
And I write to "Berksfile.lock" with:
|
448
|
-
"""
|
449
|
-
DEPENDENCIES
|
450
|
-
fake
|
451
|
-
path: .
|
452
|
-
metadata: true
|
453
|
-
|
454
|
-
GRAPH
|
455
|
-
fake (0.0.0)
|
456
|
-
"""
|
457
|
-
And the Chef Server has frozen cookbooks:
|
458
|
-
| fake | 0.0.0 |
|
459
|
-
When I successfully run `berks upload`
|
460
|
-
Then the output should contain:
|
461
|
-
"""
|
462
|
-
Skipping fake (0.0.0) (frozen)
|
463
|
-
"""
|
464
|
-
|
465
|
-
Scenario: When the syntax check is skipped
|
466
|
-
Given a cookbook named "fake"
|
467
|
-
And the cookbook "fake" has the file "recipes/default.rb" with:
|
468
|
-
"""
|
469
|
-
Totally not valid Ruby syntax
|
470
|
-
"""
|
471
|
-
And the cookbook "fake" has the file "templates/default/file.erb" with:
|
472
|
-
"""
|
473
|
-
<% for %>
|
474
|
-
"""
|
475
|
-
And the cookbook "fake" has the file "recipes/template.rb" with:
|
476
|
-
"""
|
477
|
-
template "/tmp/wadus" do
|
478
|
-
source "file.erb"
|
479
|
-
end
|
480
|
-
"""
|
481
|
-
And the cookbook "fake" has the file "Berksfile" with:
|
482
|
-
"""
|
483
|
-
source 'https://supermarket.chef.io'
|
484
|
-
metadata
|
485
|
-
"""
|
486
|
-
And the cookbook "fake" has the file "Berksfile.lock" with:
|
487
|
-
"""
|
488
|
-
DEPENDENCIES
|
489
|
-
fake
|
490
|
-
path: .
|
491
|
-
metadata: true
|
492
|
-
|
493
|
-
GRAPH
|
494
|
-
fake (0.0.0)
|
495
|
-
"""
|
496
|
-
And I cd to "fake"
|
497
|
-
When I successfully run `berks upload --skip-syntax-check`
|
498
|
-
Then the Chef Server should have the cookbooks:
|
499
|
-
| fake | 0.0.0 |
|