Copado‎ > ‎

Jenkins Plugin

With this plugin you can add a build step to your Jenkins project that executes a Copado Webhook API task. You would add this step after your Copado setup is finished. After the Copado Webhook is triggered, the plugin will wait for the job run to finish (or timeout). If the Job step is successful, your pipeline will continue to the next step in your pipeline; however, if it fails (or times out), the build will be marked as failed. 

Installing

  1. Search for the Copado Plugin within your Jenkins plugin administrator
  2. Install it
  3. Restart Jenkins

Prerequisites

  1. Webhook URL - review Webhook API http://docs.copado.apiary.io
  2. API Key - in order for the plugin to start the Job and check on the status (via the Copado Webhook API), it requires an API key. To create an api key, login to your Copado account and navigate to the Account Summary tab, and finally on the API Key sub-tab.

Usage

  1. Open your project configuration from the Jenkins dashboard.
  2. In the build section, click Add build step and select Copado Webhook.
  3. In the Webhook URL field, paste in the URL and make sure that Salesforce Ids and API Key parameter are set. For the API Key field, paste in the API Key from above.
  4. Save your Jenkins project.

Support for Git webhook payload

When using a Webhooks to trigger a Copado task in Jenkins, if you need to pass the payload from your Git server into the Copado jenkins task, you need to create a String Parameter called "payload", then Copado will read the parameter and pass it through the Copado build task.

Add the parameter to the project
add string parameter  

Set the name as "payload"

Finally, make sure that on  your git server you POST the payload to the parameterised jenkins job URL: {server}/job/{project_id}/buildWithParameters

Screenshots

  • Jenkins dashboard with multiple Copado tasks

  • Step detail

More information

  1. Github repo
  2. Jenkins plugin wiki
  3. Jenkins site
Comments