The purpose of this repository is the demonstration of the Chef Tracking Plugin for jenkins by CloudBees the Enterprise Jenkins Company
For prepairing the jenkins environment, you have to do the following:
-
Download a latest jenkins from jenkins-ci.org.
-
Install Chef Tracking Plugin
-
Install Git Plugin (required for the ChefSample job)
-
Using the jenkins-cli create and enable the ChefSample job using the config.xml seed
Get the jenkins cli, create and enable the jobs by:
$ ./get_cli.sh
$ ./create_jobs.sh
When you're ready with the job creation, just schedule (start) the job once. This will create an artifact which is going to be used by our chef cookbook.
You'll need VirtualBox, Vagrant and Chef Development Kit to be installed on your system. Additionally you need to install a few vagrant plugins:
$ vagrant plugin install vagrant-chef-zero
$ vagrant plugin install vagrant-omnibus
$ vagrant plugin install vagrant-berkshelf
$ vagrant plugin install vagrant-triggers
When you're ready with the preparation, you can fire up a chef server and a client using the following commands in the root of the repository:
$ berks install
$ vagrant up
This command will:
- start up a local chef-zero chef server
- download an ubuntu-precise image
- resolve and download the cookbook dependencies (using the berkself plugin)
- upload the cookbooks to the chef-server (using the chef-zero pugin)
- start a virtual ubuntu server and install chef on it (using the omnibus plugin)
- start chef-client on the server :)
In case if you want to re-run chef-client, you only have to run:
$ vagrant provision
The chef run is going to grab the latest artifact built by the ChefSample job, and place that file on your virtual ubuntu server. The chef-handler-jenkins submits information about what chef has deployed. It monitors chef's activities and find out which files have been updated.
When you go back to your jenkins build and check your artifact's fingerprint, you'll see new information about when and where was your tracked artifact deployed.
- Chef Handler Jenkins: chef exception and report handler
- Berkshelf
- chef-zero
- vagrant-omnibus