cookbook 'jenkins_utils', '~> 0.1.4'
jenkins_utils (5) Versions 0.1.4 Follow11
Utilities for managing Jenkins jobs with Chef.
cookbook 'jenkins_utils', '~> 0.1.4', :supermarket
knife supermarket install jenkins_utils
knife supermarket download jenkins_utils
jenkins_utils
Resources / providers for managing Jenkins CI jobs with Chef.
Leveraging this cookbook and the official Jenkins cookbook
you can easily add jobs to test your Chef cookbooks to a Jenkins CI server.
Requirements
- Chef 11+
- Ruby 1.9.3+
Usage
You'll need a Jenkins CI server managed by Chef. This cookbook's default
recipe will take care of this for you, or (more likely) you can write your own master and slave recipes and add the deps
recipe from this cookbook to those systems. You can then use the LWRPs listed below to aid in the management of your Jenkins CI jobs.
LWRPs
jenkins_utils_custom_file
Use this resource to make custom config files available to jobs in Jenkins. Uses the config-file-provider
Jenkins plugin. At this time all files use the custom (plain text) type but adding additional LWRPs for the other file types supported by this plugin would be trivial. This resource is especially useful for overriding test kitchen configurations (using a .kitchen.local.yml
file). Example usage:
jenkins_utils_custom_file ".kitchen.local.yml-openstack" do
id '.kitchen.local.yml-openstack'
comment 'Change test kitchen driver to openstack'
content ['---', 'driver:', ' name: openstack']
end
Specify content as an array of strings representing the lines in the file.
jenkins_utils_cookbook_job
Use this resource to add jobs that test cookbooks. Example:
jenkins_utils_cookbook_job "sudo" do
description 'Job to test the Chef cookbook that installs the openssh package.'
git_repo_url 'https://github.com/opscode-cookbooks/openssh.git'
git_branch 'master'
commands ['bundle exec rspec', 'bundle exec foodcritic .', 'bundle exec rubocop', 'bundle exec kitchen test']
managed_files [{'file_id' => '.kitchen.local.yml-openstack'}, {'target_location' => '.kitchen.local.yml'}]
rvm_env '1.9.3'
end
This will add a job that tests the official openssh cookbook. Note that it includes a managed_files attribute that references the ID of the custom file we added in the previous resource. See source and test fixtures for other options available including various build pipeline options, scheduling options and setting an auth token for ad-hoc/script triggered builds.
Development
Pretty standard workflow:
- Fork
- Write tests
- Make changes that implement tests
bundle install
bundle exec rake
- Submit a pull request
Authors
- David Schlenk david.schlenk@spanlink.com
Roughly inspired/based on Zachary Stevens' Cooking With Jenkins cookbook.
License
Copyright 2014 Spanlink Communications, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Dependent cookbooks
apt >= 0.0.0 |
jenkins >= 0.0.0 |
rvm >= 0.0.0 |
git >= 0.0.0 |
java >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
0.1.0
Initial release of .
-
Enhancements
- an enhancement
-
Bug Fixes
- a bug fix
Collaborator Number Metric
0.1.4 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.4 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.4 failed this metric
FC064: Ensure issues_url is set in metadata: jenkins_utils/metadata.rb:1
FC065: Ensure source_url is set in metadata: jenkins_utils/metadata.rb:1
FC066: Ensure chef_version is set in metadata: jenkins_utils/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: jenkins_utils/metadata.rb:1
FC069: Ensure standardized license defined in metadata: jenkins_utils/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:17
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:29
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:34
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:46
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:58
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:70
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/custom_file.rb:16
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/custom_file.rb:27
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/custom_file.rb:37
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.4 passed this metric
Testing File Metric
0.1.4 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.4 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.4 failed this metric
0.1.4 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.4 failed this metric
FC064: Ensure issues_url is set in metadata: jenkins_utils/metadata.rb:1
FC065: Ensure source_url is set in metadata: jenkins_utils/metadata.rb:1
FC066: Ensure chef_version is set in metadata: jenkins_utils/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: jenkins_utils/metadata.rb:1
FC069: Ensure standardized license defined in metadata: jenkins_utils/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:17
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:29
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:34
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:46
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:58
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:70
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/custom_file.rb:16
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/custom_file.rb:27
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/custom_file.rb:37
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.4 passed this metric
Testing File Metric
0.1.4 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.4 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.4 failed this metric
FC065: Ensure source_url is set in metadata: jenkins_utils/metadata.rb:1
FC066: Ensure chef_version is set in metadata: jenkins_utils/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: jenkins_utils/metadata.rb:1
FC069: Ensure standardized license defined in metadata: jenkins_utils/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:17
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:29
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:34
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:46
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:58
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/cookbook_job.rb:70
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/custom_file.rb:16
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/custom_file.rb:27
FC085: Resource using new_resource.updated_by_last_action to converge resource: jenkins_utils/providers/custom_file.rb:37
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.1.4 passed this metric
Testing File Metric
0.1.4 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.4 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.4 failed this metric
0.1.4 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