cookbook 'environment-version', '~> 0.1.0'
environment-version (1) Versions 0.1.0 Follow0
Provides a library function to check chef environment versions
cookbook 'environment-version', '~> 0.1.0', :supermarket
knife supermarket install environment-version
knife supermarket download environment-version
environment-version cookbook
As of Chef 11.6, environments are not able to be versioned. This cookbook
provides a library function that lets you maintain versioning information
in your environments file.
This is probably more of a hack than a good solution. But, it solves my
problem for now.
Requirements
Be aware of the following constraints when using chef environments:
- Chef solo only supports environments in 11.6+
- Vagrant only supports environments in 1.3+
Usage
You set the version attribute in your environment file like so:
name "test"
description "Test environment"
default_attributes(
:environment_version => 3,
# other attributes go here
)
In your cookbook's metadata.rb, add
depends "environment-version"
And in your recipe, add
environment_version_ensure(
:production => 3,
:test => 4
)
See the test directory for a working example.
Author
Author:: Dustin Spicuzza (dustin@virtualroadside.com)
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.1.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 failed this metric
FC064: Ensure issues_url is set in metadata: environment-version/metadata.rb:1
FC065: Ensure source_url is set in metadata: environment-version/metadata.rb:1
FC066: Ensure chef_version is set in metadata: environment-version/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: environment-version/metadata.rb:1
FC069: Ensure standardized license defined in metadata: environment-version/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.0 failed this metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 failed this metric
FC064: Ensure issues_url is set in metadata: environment-version/metadata.rb:1
FC065: Ensure source_url is set in metadata: environment-version/metadata.rb:1
FC066: Ensure chef_version is set in metadata: environment-version/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: environment-version/metadata.rb:1
FC069: Ensure standardized license defined in metadata: environment-version/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.0 failed this metric
FC065: Ensure source_url is set in metadata: environment-version/metadata.rb:1
FC066: Ensure chef_version is set in metadata: environment-version/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: environment-version/metadata.rb:1
FC069: Ensure standardized license defined in metadata: environment-version/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.0 failed this metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number