Wednesday, July 5, 2017

Chef integration with Jenkins

Chef Continuous integration with Jenkins 

We are going to setup with below diagram. 




From workstation we are writing cookbooks and uploading them to chef server. Now every change in cookbook we need to upload these changes manually to chef server.  

If we want to make it automated then we can use CI/CD tools like Jenkins and bamboo server. Here we are going to see Jenkins integration with chef server. 

We are going to install Jenkins on workstation. Jenkins will check for the new codes from git and upload them to chef-server and after that we can execute the chef-client on chef client server. 

we can follow Jenkins server installation on below url:  https://tinyurl.com/y8znswrn

Get login into console of Jenkins server and start creating project.

Step 1: Get started creating of free style project.



Step 2:  We need to choose git and paste the master repo path from where we want to get the codes.


Step 3:  Here we can specify poll for SCM.


Step 4: We can write bash command to execute on poll execution.


Step 5: We check the console output after click on console.


Step 6: Finally chef-client successfully executed on remote machine.


Step 7:  We can check the git contents on workstation machine.


Conclusion: Once we commit the changes in git repository, then Jenkins will pull the changes from master repo to workstation machine and execute the commands.