Skip to content
Zhelyan edited this page Feb 11, 2016 · 10 revisions

The story in pictures

Authenticate with the Chef server. You can create multiple credentials if you wish.

- Configure the credential from a knife/client .rb file. This should be an admin client! The .rb/.pem files can be deleted later.

image

- Confirm the auth succeeded

image

Configure your job.

- Add a new Build parameter - 'List Chef enviroments'. Note that you can replace this with any build parameter or env variable as long as you reference it in the build wrapper (see below)

image

- Add new Build wrapper - 'Save details to data bag item'. The wrapper needs to know which environment you are deploying to, which packages and where you want to save this information (in which Chef data bag item)

image

Add a new build step which runs chef-client on the servers. You can skip this step if you don't require immediate deployment. Given that the chef-client service is running on your servers it will eventually deploy the changes.

For immediate deployment you can do something like:

  knife ssh "chef_environment:$ENV AND role:myapp 'sudo chef-client'" 

Run the job. If you have parameterized the build and if you used the 'List Chef environments' parameter the plugin will retrieve the environments from the Chef server

image

The selected data bag item will be updated:

image

The plugin will generate environment report page where you can track what got deployed where

This is available for both the project and for individual builds:

image

Report

image

Clone this wiki locally