Jenkins CI with Chef Server

半腔热情 提交于 2019-12-21 21:29:09

问题


Is there any way I can integrate Jenkins with Chef Server so that I can create jobs to be executed? I don't want to have to go to the Chef Workstation.

Do I need to install jenkins on a separate server or the chef workstation?

Can I execute all the recipes directly from the Jenkins console?


回答1:


Yes. You can create jobs in jenkins and can be integrated with chef. Knife search would be the best option. you can run chef-client to run recipes through jenkins to any machine.




回答2:


Look into this chef-plugin. It might help. I have not tried it.

I hope this helps.




回答3:


We managed to have this working except automatic deployment (I am doing some research if there is such thing yet).

What I recommend is having Jenkins slave connecting to your master (i.e. using Swarm plugin). This slave could be machine (i.e. Ubuntu server edition) with QEMU/KVM virtualization, Ruby, Vagrant (or other tool), ChefClien, TestKitchen, RSpecs (chefspecs) and Foodcritic. There is Chef Development Kit that has many of this.

What build do:

  1. Checkout your chef repository
  2. Run `kitchen test all' (or only subset of your suites)
  3. If status is 0 then execute rspec --format doc (from yours cookbook directory
  4. If status is 0 then execute foodcritic -f
  5. If status is 0 then you can upload your cookbook knife upload cookbooks/my_cookbook

What we haven't figure out yet is:

  • Update (increase) version of cookbook (if doing release)
  • Still quite error prone approach using status and shell scripts in jenkins build

More resources:

  • Foodcritic CI



回答4:


try these Jenkins plugins:

https://github.com/zhelyan/jenkins-chef-api

together with

https://github.com/zhelyan/jenkins-chef-wrapper



来源:https://stackoverflow.com/questions/24861027/jenkins-ci-with-chef-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!