Jenkins Plugin
Run your Gatling Enterprise simulations from your Jenkins CI.
Purpose of this plugin
This plugin enables you to start a Gatling Enterprise simulation directly from your Jenkins platform. This plugin links a Jenkins job with one and only one Gatling Enterprise simulation.
This plugin doesn’t create a new Gatling Enterprise simulation, you have to create it using the Gatling Enterprise Dashboard before.
Installation
To download the plugin, you need to get the hpi file located at:
https://downloads.gatling.io/releases/frontline-jenkins-plugin/1.15.3/frontline-jenkins-plugin-1.15.3.hpi
You need to be connected as an administrator of your Jenkins application to install it. Go Manage Jenkins, Manage Plugins, Advanced, Upload Plugin, and choose the hpi file.

Configuration
The plugin needs some global configuration. Go Manage Jenkins, Configure System, then Global Gatling Enterprise Plugin Configuration.
The API Token will allow Jenkins to authenticate to Gatling Enterprise. To fetch the API Token, refer to the section Managing API Tokens in the Gatling Enterprise User Guide.
You can configure the API Token globally in this page, or per CI project if each project has a API Token scoped on a specific team. We recommend storing the API Token in a secret text credential, but you can also copy the content of the API Token in the second field.
The Address is the address of your Gatling Enterprise API, for example: https://demo-beta.gatling.io.

Job set-up
Set-up for a pipeline job (available since Jenkins 2.0)
Basics
You can use the Pipeline Snippet Generator to help you use the Jenkins Plugin. Click on the Pipeline Syntax link, then choose the step gatlingFrontLineLauncherStep
.

You can specify the id of an API Token stored in a secret text credential if you don’t want to use the one configured globally. Choose one of the simulation in the drop-down, then click Generate Groovy. Copy and paste the result in your Pipeline script, eg:
node {
stage("Gatling Enterprise simulation") {
gatlingFrontLineLauncherStep credentialId: '6737158c-0ff6-4033-91ad-6f3a811aab52', '00eacd1c-ef91-4076-ad57-99b4c6675a9e'
}
}

Passing parameters
You can also specify a custom Map of system properties which will be used in the Gatling Enterprise run. The syntax is the following:
gatlingFrontLineLauncherStep(simulationId: '00eacd1c-ef91-4076-ad57-99b4c6675a9e', systemProps: ["var": "$var1", "sensitive.var2": "this prop won't be displayed in the run snapshot"])
Displaying assertions as JUnit
You can display the results of the Gatling Enterprise assertions with the JUnit plugin. Add the following line:
junit("gatlingFrontLineJunitResults/*.xml")
Set-up for an old style job
Add a new build step called FrontLine Plugin. Choose in the Simulation list the simulation you want to use. You can specify the id of an API Token stored in a credential if you don’t want to use the one configured globally.

You can display the results of the Gatling Enterprise assertions with the JUnit plugin.
Add a new build step called Publish JUnit test result report and fill the Test report XMLs input with the following line:
gatlingFrontLineJunitResults/*.xml

Usage
A new Gatling Enterprise simulation will be started every time the job is run. Check the Console Output to check the simulation progress. If the simulation ran successfully, it will look like the following:

If the Gatling Enterprise deployment fails (i.e. because of a shortage of available hosts), the plugin will retry 3 times to redeploy the simulation.
Live metrics will be displayed in the console, and in the Status page. The link View Run in FrontLine in the build page menu links to Gatling Enterprise.
