Menu

Trigger Jenkins

Overview

TriggerJenkins.js

This 'Pulse Rule' sample triggers a Jenkins Job using the API of Jenkins. Set up 'Rules' for your own 'Event' (webhook) and use the sample 'Actions' provided below.

Important: Your Jenkins instance should be configured to allow a remote trigger. Verify with CURL before using this action from Pulse.

Setup Pulse Rule

  1. Review the Pulse Quick Start Guide for complete instructions on how to add Pulse Events, Actions, and Rules.
  2. Enter the sample Program Code in the Pulse Actions. 
    Note: For the most up to date sample program code, view the QASymphony/PulseRules repository.

Constants

Anything that uses constants.X will need your own constants value.

  • constants.JenkinsUserName
  • constants.JenkinsURL
  • constants.JenkinsJobName

The following Constants information is found within your Jenkins application.

  • constants.JenkinsJobToken
  • constants.JenkinsAPIToken

Variables

Fields with a $ and all caps that look like a variable must be updated.

If you'd like to notify Slack that your Jenkins build has been triggered, fill out the variable with the Slack Event name. If not, remove the emitEvent line from this action.

Example: In triggerJenkins.js, please replace 

  • $YOUR_SLACK_EVENT_NAME

CucumberJenkinsExecuteShell.sh

This 'Pulse Rule' sample is used for the Jenkins Execution Post Build Shell Action Configuration for Cucumber for Java with .json output.  

Setup Pulse Rule

  1. Review the Pulse Quick Start Guide for complete instructions on how to add Pulse Events, Actions, and Rules.

  2. Enter the sample Program Code in the Pulse Actions.
    Note: For the most up to date sample program code, view the QASymphony/PulseRules repository.

Variables

Fields with a $ and all caps that look like a variable must be updated.

Example: In CucumberJenkinsExecuteShell.sh, please replace 

  • $YOUR_PULSE_RULE_EVENT_URL
  • $YOUR_TEST_CYCLE_ID (where your test results will go in qTest Manager)
  • $YOUR_PROJECT_ID

 

Subscribe To Our Blog
Powered by Zendesk