Other CI/CD systems
Run your Gatling Enterprise simulations from any CI/CD product.
We provide dedicated support for a number of CI tools: GitHub Actions, Gitlab CI, Jenkins, Teamcity, Bamboo. However, we also document here how to run your simulations on Gatling Enterprise from any other CI products, using either one of the supported build tools or our CI shell script.
This will not create a new Gatling Enterprise simulation, you have to create it using the Gatling Enterprise Dashboard before, or do it using the options provided by our build tools plugins:
Don’t forget to check out GitLab’s official documentation to learn how to write CI/CD pipelines with GitLab CI/CD.
You must first create an API token. It will be used to authenticate with Gatling Enterprise. Most CI tools should offer a way to store this token securely, and expose it to build scripts as an environment variable.
In the following examples, we assume the API Token is available in an environment variable named
GATLING_ENTERPRISE_API_TOKEN, which our tools will detect automatically.
We also assume that you have already configured a simulation on Gatling Enterprise. You can copy the simulation ID from the simulations list view. In the following examples, we will show the simulation ID as
Using a build tool plugin
You can build you Simulation, and then run the updated Simulation on Gatling Enterprise, using the
enterpriseStart command with any of our supported build tools.
waitForRunEnd=true option, it will display live metrics until the end of the run, and exit with an error code if the run fails on Gatling Enterprise (e.g. if the run crashes or if the assertions fail).
Configure your CI build to run the command corresponding to the build tool you use:
gradle gatlingEnterpriseStart \ -Dgatling.enterprise.simulationId=00000000-0000-0000-0000-000000000000 \ -Dgatling.enterprise.waitForRunEnd=true
./gradlew gatlingEnterpriseStart \ -Dgatling.enterprise.simulationId=00000000-0000-0000-0000-000000000000 \ -Dgatling.enterprise.waitForRunEnd=true
mvn gatling:enterpriseStart \ -Dgatling.enterprise.simulationId=00000000-0000-0000-0000-000000000000 \ -Dgatling.enterprise.waitForRunEnd=true
sbt Gatling/enterpriseStart \ -Dgatling.enterprise.simulationId=00000000-0000-0000-0000-000000000000 \ -Dgatling.enterprise.waitForRunEnd=true
Using a shell script
This script launches an existing simulation on Gatling Enterprise and displays live metrics.
It can be downloaded here.
Shell script requirements
This script runs with:
curlHTTP client, see here for more information
jqJSON processor, see here for more information
These tools must be installed on the machine or container where your CI system will execute the script.
Shell script usage
You need to give 3 parameters to the script:
- Gatling Enterprise url:
- API token: the API token will allow the script to authenticate to Gatling Enterprise. The API token needs the Start permission.
- Simulation ID: the ID of the simulation you want to start. You can get this ID on the Simulations table, with the icon.
Configure your CI build to call the script like this:
./start_simulation.sh 'https://cloud.gatling.io' "$GATLING_ENTERPRISE_API_TOKEN" '00000000-0000-0000-0000-000000000000'