How to run GenRocket Scenarios via Jenkins
This article will lead you through the steps of integrating GenRocket Scenarios into your Jenkins Continuous Integration (CI) pipeline. This article assumes you already have your Jenkins Server setup.
Step 1: Download and Install the GenRocket Runtime on Jenkins Server
This step is identical to downloading and installing the GenRocket Runtime onto your local computer.
- How to install the GenRocket Runtime on windows
- How to install the GenRocket Runtime on Mac OS / Linux
Step 2a: Set the GenRocket Environment Variables in Jenkins
You will need to set the Environment variable GEN_ROCKET_HOME to the path where you have downloaded the GenRocket Runtime on your Jenkins Server and then update the PATH variable. You can do this via the Jenkins GUI by following the below steps:
Step 2b: Click Manage Jenkins
Step 2c: Click Configure System
Step 2d: Add and Update Environment Variables
- On the Configure System form, add and update environment variables
- Set the environment variable GEN_ROCKET_HOME to the path where you have downloaded the GenRocket Runtime
- Update the PATH variable
Step 3: Add the Jenkins Server to the GenRocket Platform
- In the Project Dashboard
- In the Resources window (far right)
- Click the "Add Server" button
Step 4: Update Resource Variables with the Appropriate Values
Update resource variables with the appropriate values with respect to Jenkins Server.
Step 5: Download your ServerProfile.grp.
- Make sure to select your server from the dropdown
- Click the "Download ServerProfile.grp"
- Place the ServerProfile.grp in the .genrocket folder of your Jenkins server
Step 6: Run the genrocket -a command to Update Generator and Receiver Jars
- Open your terminal or command line application on the Jenkins Server
- Run the genrocket -a command to update Generator and Receiver Jars
Step 7: Creating a Jenkins Job to run GenRocket Scenarios
- Open Jenkins and create a new Job
- Add an item name
- Select Freestyle project
- Click OK
Step 8: Navigate to Build tab
- You will now be on the Configuration page.
- Navigate to the Build tab
Step 9: Click on Add Build Step to select the Execute Shell option from the dropdown in the Build section
Step 10: Add the following script to run the Scenario in the text area.
The script below will execute the scenarios in $HOME/scenarios folder. Note, this example assumes you have a UserScenario.grs in this folder. You can modify this script to run your Scenarios.
#!/bin/bash cd ~/scenarios genrocket -r UserScenario.grs
Step 11: Run your Jenkins job and view output
You can now run GenRocket Scenarios via Jenkins.
Output Directory on Jenkins Server: /var/lib/jenkins/output