berkshelf 7.0.7 → 7.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/berkshelf.gemspec +8 -9
  4. data/bin/berks +5 -0
  5. data/lib/berkshelf/cached_cookbook.rb +1 -1
  6. data/lib/berkshelf/chef_config_compat.rb +1 -0
  7. data/lib/berkshelf/chef_repo_universe.rb +2 -2
  8. data/lib/berkshelf/formatters/json.rb +3 -3
  9. data/lib/berkshelf/lockfile.rb +3 -3
  10. data/lib/berkshelf/uploader.rb +3 -3
  11. data/lib/berkshelf/version.rb +1 -1
  12. metadata +32 -186
  13. data/.github/lock.yml +0 -1
  14. data/.gitignore +0 -30
  15. data/.rubocop.yml +0 -12
  16. data/.travis.yml +0 -73
  17. data/CHANGELOG.legacy.md +0 -307
  18. data/CHANGELOG.md +0 -1589
  19. data/CONTRIBUTING.md +0 -68
  20. data/Gemfile.lock +0 -292
  21. data/PLUGINS.md +0 -25
  22. data/README.md +0 -72
  23. data/Thorfile +0 -61
  24. data/appveyor.yml +0 -31
  25. data/docs/berkshelf_for_newcomers.md +0 -64
  26. data/features/artifactory.feature +0 -70
  27. data/features/berksfile.feature +0 -46
  28. data/features/commands/apply.feature +0 -41
  29. data/features/commands/contingent.feature +0 -47
  30. data/features/commands/info.feature +0 -141
  31. data/features/commands/install.feature +0 -646
  32. data/features/commands/list.feature +0 -78
  33. data/features/commands/outdated.feature +0 -176
  34. data/features/commands/package.feature +0 -17
  35. data/features/commands/search.feature +0 -17
  36. data/features/commands/shelf/list.feature +0 -32
  37. data/features/commands/shelf/show.feature +0 -113
  38. data/features/commands/shelf/uninstall.feature +0 -96
  39. data/features/commands/show.feature +0 -83
  40. data/features/commands/update.feature +0 -142
  41. data/features/commands/upload.feature +0 -499
  42. data/features/commands/vendor.feature +0 -154
  43. data/features/commands/verify.feature +0 -29
  44. data/features/commands/viz.feature +0 -66
  45. data/features/community_site.feature +0 -37
  46. data/features/help.feature +0 -11
  47. data/features/json_formatter.feature +0 -158
  48. data/features/lifecycle.feature +0 -378
  49. data/features/lockfile.feature +0 -378
  50. data/features/step_definitions/berksfile_steps.rb +0 -54
  51. data/features/step_definitions/chef/config_steps.rb +0 -12
  52. data/features/step_definitions/chef_server_steps.rb +0 -60
  53. data/features/step_definitions/cli_steps.rb +0 -18
  54. data/features/step_definitions/config_steps.rb +0 -46
  55. data/features/step_definitions/environment_steps.rb +0 -11
  56. data/features/step_definitions/filesystem_steps.rb +0 -286
  57. data/features/step_definitions/gem_steps.rb +0 -13
  58. data/features/step_definitions/json_steps.rb +0 -29
  59. data/features/step_definitions/utility_steps.rb +0 -11
  60. data/features/support/aruba.rb +0 -12
  61. data/features/support/env.rb +0 -77
  62. data/spec/fixtures/cookbooks/example_cookbook/.gitignore +0 -2
  63. data/spec/fixtures/cookbooks/example_cookbook/.kitchen.yml +0 -26
data/Thorfile DELETED
@@ -1,61 +0,0 @@
1
- # encoding: utf-8
2
- $:.unshift File.expand_path("../lib", __FILE__)
3
-
4
- require "bundler"
5
- require "thor/rake_compat"
6
-
7
- class Gem < Thor
8
- include Thor::RakeCompat
9
- Bundler::GemHelper.install_tasks
10
-
11
- desc "build", "Build berkshelf-#{Berkshelf::VERSION}.gem into the pkg directory"
12
- def build
13
- Rake::Task["build"].execute
14
- end
15
-
16
- desc "install", "Build and install berkshelf-#{Berkshelf::VERSION}.gem into system gems"
17
- def install
18
- Rake::Task["install"].execute
19
- end
20
-
21
- desc "release", "Create tag v#{Berkshelf::VERSION} and build and push berkshelf-#{Berkshelf::VERSION}.gem to Rubygems"
22
- def release
23
- Rake::Task["release"].execute
24
- end
25
- end
26
-
27
- class Spec < Thor
28
- include Thor::Actions
29
- default_task :all
30
-
31
- desc "all", "Run all specs and features"
32
- def all
33
- exit(units_command && acceptance_command)
34
- end
35
-
36
- desc "ci", "Run tests on Travis"
37
- def ci
38
- ENV["CI"] = "true" # Travis-CI also sets this, but set it here for local testing
39
- all
40
- end
41
-
42
- desc "unit", "Run unit tests"
43
- def unit
44
- exit(units_command)
45
- end
46
-
47
- desc "acceptance", "Run acceptance tests"
48
- def acceptance
49
- exit(acceptance_command)
50
- end
51
-
52
- no_tasks do
53
- def units_command
54
- run("rspec --color spec/unit")
55
- end
56
-
57
- def acceptance_command
58
- run("cucumber --color --tags ~@no_run --strict")
59
- end
60
- end
61
- end
@@ -1,31 +0,0 @@
1
- version: "master-{build}"
2
-
3
- os: Windows Server 2012 R2
4
- platform:
5
- - x64
6
-
7
- clone_depth: 1
8
- skip_tags: true
9
- skip_branch_with_pr: true
10
- branches:
11
- only:
12
- - master
13
-
14
- # caching vendor/bundle appears to break horribly in the face of gems checked out of git
15
- # cache:
16
- # - vendor/bundle
17
-
18
- install:
19
- - ps: iex (irm https://omnitruck.chef.io/install.ps1); Install-Project -Project chefdk -channel stable
20
- - bundle config --local path vendor/bundle
21
- - SET CI=true
22
- - SET BUNDLE_WITHOUT=changelog:style
23
-
24
- build_script:
25
- - ps: c:\opscode\chefdk\bin\chef.bat shell-init powershell | iex
26
- - bundle install || bundle install || bundle install
27
-
28
- test_script:
29
- - SET SPEC_OPTS=--format progress
30
- - c:\opscode\chefdk\bin\chef.bat exec bundle exec rake spec
31
- - c:\opscode\chefdk\bin\chef.bat exec bundle exec cucumber --tags ~@not-windows
@@ -1,64 +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](https://docs.chef.io/berkshelf.html#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](https://docs.chef.io/berkshelf.html#berkshelf-cli), 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
- * https://docs.chef.io/berkshelf.html
61
-
62
- --
63
-
64
- Good luck with Berkshelf!
@@ -1,70 +0,0 @@
1
- Feature: Installing cookbooks from an Artifactory server
2
- This integration test uses some environment variables to configure which
3
- Artifactory server to talk to, as there is no ArtifactoryZero to test against.
4
- If those aren't present, we skip the tests.
5
-
6
- $TEST_BERKSHELF_ARTIFACTORY - URL to the Chef virtual repository.
7
- $TEST_BERKSHELF_ARTIFACTORY_API_KEY - API key to use.
8
-
9
- Scenario: when the cookbook exists
10
- Given I have a Berksfile pointing at an authenticated Artifactory server with:
11
- """
12
- cookbook 'poise', '2.7.2'
13
- """
14
- When I successfully run `berks install`
15
- Then the output should contain:
16
- """
17
- Installing poise (2.7.2)
18
- """
19
- And the cookbook store should have the cookbooks:
20
- | poise | 2.7.2 |
21
-
22
- Scenario: when the cookbook does not exist
23
- Given I have a Berksfile pointing at an authenticated Artifactory server with:
24
- """
25
- cookbook '1234567890'
26
- """
27
- When I run `berks install`
28
- Then the output should contain:
29
- """
30
- Unable to find a solution for demands: 1234567890 (>= 0.0.0)
31
- """
32
- And the exit status should be "NoSolutionError"
33
-
34
- Scenario: when the cookbook exists, but the version does not
35
- Given I have a Berksfile pointing at an authenticated Artifactory server with:
36
- """
37
- cookbook 'poise', '0.0.0'
38
- """
39
- When I run `berks install`
40
- Then the output should contain:
41
- """
42
- Unable to find a solution for demands: poise (= 0.0.0)
43
- """
44
- And the exit status should be "NoSolutionError"
45
-
46
- Scenario: when the API key is not present:
47
- Given I have a Berksfile pointing at an Artifactory server with:
48
- """
49
- cookbook 'poise'
50
- """
51
- When I run `berks install`
52
- Then the output should contain:
53
- """
54
- Unable to find a solution for demands: poise (>= 0.0.0)
55
- """
56
- And the exit status should be "NoSolutionError"
57
-
58
- Scenario: when the API key is given in $ARTIFACTORY_API_KEY:
59
- Given I have a Berksfile pointing at an Artifactory server with:
60
- """
61
- cookbook 'poise', '2.7.2'
62
- """
63
- And the environment variable ARTIFACTORY_API_KEY is $TEST_BERKSHELF_ARTIFACTORY_API_KEY
64
- When I successfully run `berks install`
65
- Then the output should contain:
66
- """
67
- Installing poise (2.7.2)
68
- """
69
- And the cookbook store should have the cookbooks:
70
- | poise | 2.7.2 |
@@ -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,47 +0,0 @@
1
- Feature: berks contingent
2
- Background:
3
- * the Chef Server is empty
4
- * the cookbook store is empty
5
-
6
- Scenario: When there are dependent cookbooks
7
- Given the cookbook store has the cookbooks:
8
- | dep | 1.0.0 |
9
- And the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
10
- | dep | ~> 1.0.0 |
11
- And the cookbook store contains a cookbook "ekaf" "1.0.0" with dependencies:
12
- | dep | ~> 1.0.0 |
13
- And I have a Berksfile pointing at the local Berkshelf API with:
14
- """
15
- cookbook 'fake', '1.0.0'
16
- cookbook 'ekaf', '1.0.0'
17
- """
18
- And I run `berks install`
19
- And I successfully run `berks contingent dep`
20
- Then the output should contain:
21
- """
22
- Cookbooks in this Berksfile contingent upon 'dep':
23
- * ekaf (1.0.0)
24
- * fake (1.0.0)
25
- """
26
-
27
- Scenario: When there are no dependent cookbooks
28
- Given the cookbook store has the cookbooks:
29
- | fake | 1.0.0 |
30
- And I have a Berksfile pointing at the local Berkshelf API with:
31
- """
32
- cookbook 'fake', '1.0.0'
33
- """
34
- And I run `berks install`
35
- And I successfully run `berks contingent dep`
36
- Then the output should contain:
37
- """
38
- There are no cookbooks in this Berksfile contingent upon 'dep'.
39
- """
40
-
41
- Scenario: When the cookbook is not in the Berksfile
42
- Given I have a Berksfile pointing at the local Berkshelf API
43
- And I successfully run `berks contingent dep`
44
- Then the output should contain:
45
- """
46
- There are no cookbooks in this Berksfile contingent upon 'dep'.
47
- """
@@ -1,141 +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
- License: All rights reserved
23
- """
24
-
25
- Scenario: When the parameter is a transitive dependency
26
- Given the cookbook store has the cookbooks:
27
- | dep | 1.0.0 |
28
- And the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
29
- | dep | ~> 1.0.0 |
30
- And I have a Berksfile pointing at the local Berkshelf API with:
31
- """
32
- cookbook 'fake', '1.0.0'
33
- """
34
- And I write to "Berksfile.lock" with:
35
- """
36
- DEPENDENCIES
37
- fake (= 1.0.0)
38
-
39
- GRAPH
40
- dep (1.0.0)
41
- fake (1.0.0)
42
- dep (~> 1.0.0)
43
- """
44
- And I successfully run `berks install`
45
- When I successfully run `berks info dep`
46
- Then the output should contain:
47
- """
48
- Name: dep
49
- Version: 1.0.0
50
- License: All rights reserved
51
- """
52
-
53
- Scenario: When the cookbook is not in the Berksfile
54
- Given I have a Berksfile pointing at the local Berkshelf API
55
- When I run `berks info fake`
56
- Then the output should contain:
57
- """
58
- 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.
59
- """
60
- And the exit status should be "DependencyNotFound"
61
-
62
- Scenario: When there is no lockfile present
63
- And I have a Berksfile pointing at the local Berkshelf API with:
64
- """
65
- cookbook 'fake', '1.0.0'
66
- """
67
- When I run `berks info fake`
68
- Then the output should contain:
69
- """
70
- 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.
71
- """
72
- And the exit status should be "DependencyNotFound"
73
-
74
- Scenario: When the cookbook is not installed
75
- Given the cookbook store is empty
76
- And I have a Berksfile pointing at the local Berkshelf API with:
77
- """
78
- cookbook 'fake', '1.0.0'
79
- """
80
- And I write to "Berksfile.lock" with:
81
- """
82
- DEPENDENCIES
83
- fake (= 1.0.0)
84
-
85
- GRAPH
86
- fake (1.0.0)
87
- """
88
- When I run `berks info fake`
89
- Then the output should contain:
90
- """
91
- Cookbook 'fake' (1.0.0) not found in the cookbook store!
92
- """
93
- And the exit status should be "CookbookNotFound"
94
-
95
- Scenario: When the cookbook is a vendored cookbook
96
- Given the cookbook store has the cookbooks:
97
- | fake | 1.0.0 |
98
- And I have a Berksfile pointing at the local Berkshelf API with:
99
- """
100
- cookbook 'fake', '1.0.0'
101
- """
102
- And I write to "Berksfile.lock" with:
103
- """
104
- DEPENDENCIES
105
- fake (= 1.0.0)
106
-
107
- GRAPH
108
- fake (1.0.0)
109
- """
110
- And the cookbook store cookbook "fake" "1.0.0" is vendored without a metadata.rb
111
- When I successfully run `berks info fake`
112
- Then the output should contain:
113
- """
114
- Name: fake
115
- Version: 1.0.0
116
- License: All rights reserved
117
- """
118
-
119
- Scenario: When the cookbook is a vendored cookbook
120
- Given the cookbook store has the cookbooks:
121
- | fake | 1.0.0 |
122
- And I have a Berksfile pointing at the local Berkshelf API with:
123
- """
124
- cookbook 'fake', '1.0.0'
125
- """
126
- And I write to "Berksfile.lock" with:
127
- """
128
- DEPENDENCIES
129
- fake (= 1.0.0)
130
-
131
- GRAPH
132
- fake (1.0.0)
133
- """
134
- And the cookbook store cookbook "fake" "1.0.0" is vendored with a metadata.rb
135
- When I successfully run `berks info fake`
136
- Then the output should contain:
137
- """
138
- Name: fake
139
- Version: 1.0.0
140
- License: All rights reserved
141
- """