Jenkins Configuration

In Jenkins, you can enable the remote build triggers by selecting the Trigger builds remotely check box on the Configuration screen.

How to Construct a Webhook URL?

While configuring for Build Triggers in the CI/CD tool, you can see the instructions below the Authentication Token field to use the URL to trigger thebuild remotely.

Normal Project

Parameterized Project

The following is an example of how to construct the Webhook URL for a normal project in Jenkins.

The URL suggested in Jenkins during the configuration of Build Triggers: JENKINS_URL /job/ Jenkins_Project_Name /build

If your Jenkins instance URL is http://qtm4j-qa-jenkins.qmetry.com:8080 and the project name is QTM4J4xCloud.

Then the URL to trigger the build will be -

http://qtm4j-qa-jenkins.qmetry.com:8080 /job/QTM4J4xCloud/build

The following is an example of how to construct the Webhook URL for a project with parameters in Jenkins.

The URL suggested in Jenkins during the configuration of Build Triggers:

JENKINS_URL /job/ Jenkins_Project_Name /buildWithParameters

If your Jenkins instance URL is http://qtm4j-qa-jenkins.qmetry.com:8080 and the project name is QTM4J4xCloud.

Then the URL to trigger the build will be -

http://qtm4j-qa-jenkins.qmetry.com:8080 /job/QTM4J4xCloud/buildWithParameters

Authorization

To supply the Authorization header with value Basic <auth>, perform the following steps:

  1. Build a string of the form username:api token using Jenkins credentials. Generate API Token in Jenkins from the API Token section of Configure in the User Profile.

  2. Encode the string in Base64 format.

  3. Supply an "Authorization" header with content "Basic " followed by the encoded string. For example, the string "admin:" encodes to "YWRtaW46MTE5ZWJiNjA0ZDJkY2NjM2E0OTEzYzFhZjVjOTIxOQ==" in base64. So the Basic <auth> value would be as follows.

    Basic YWRtaW46MTE5ZWJiNjA0ZDJkY2NjM2E0OTEzYzFhZjVjOTIxOQ==

Publication date: