Upload cookbook via Jenkins pipeline code

Hi Friends

I am trying to upload a cookbook to chef-server via Jenkinsfile pipeline code. However, my code is not working.

Could somebody please share the Jenkins pipeline code to upload the cookbook to chef-server?

My set-up is as follows:

  1. Jenkins server running on Ubuntu 18.x
  2. using the hosted chef-server
  3. using cloud bitbucket as a code repo

Thanks
Jagat Pradhan

You forgot a vital step.

  1. Test the cookbook before you load it to the Chef server.

To do so, I'd encourage you to commit the cookbooks to a git repo and use "cloud-zero" to test the cookbook, perhaps in a docker or VM that is a Jenkins node.