Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Some of our customers wish to pass Branch Name as a Jenkins input parameter for the Packager job so that a specific Datical Pipeline can be targeted. The below steps outline how this can be performed using the Generic Webhook Trigger Plugin.

Generic Webhook Trigger Pluggin

This plugin allows Jenkins access to the HTTP payload that triggered the build. Values, such as Branch name, can be extracted from the payload and used as filters and passed to Jenkins input parameters.

Instructions

  1. In Jenkins, install the Generic Webhook Trigger Pluggin using Manage Jenkins → Manage Plugins

  2. After installing the plugin you will see a checkbox under Build Triggers for Generic Webhook Trigger. Check the box to access the configurations.

  3. In the Post content parameters add a variable, eg. ref. You will need to provide a JSONPath or XPath expression to extract the value from the HTTP payload.

    1. Sample HTTP payload from my Github webhook can be found here -

    2. A JSONPath evaluator can be found here - https://jsonpath.com/

    3. In this example we have two variables:

      1. ref - this will be used to extract the branch name from the SQL Repo triggering the webhook

      2. author - this will be used to extract the author of the change so that Jenkins user can be excluded from the webhook. W

  • No labels