Integrate Jenkins on Docker hosted in Ubuntu
- An active floating Katalon Runtime Engine license.
- Docker and Jenkins already installed and configured. You can learn how to install Docker and Jenkins in this Jenkins guide: Docker.
Docker is a platform for running applications in an isolated environment called a Docker container. Applications like Jenkins can be downloaded as read-only images, each of which is run in Docker as a container.
However, when your Jenkins is installed on a dynamic Docker hosted in Ubuntu without GUI, you might not be able to configure build and integration with Katalon Studio from the user interface normally.
This tutorial will guide you through configuring and building your Katalon Project with Jenkins on Docker hosted in Ubuntu. Your Katalon Project will be run with Katalon Studio Docker Image; hence pre-installed Katalon Studio and Katalon Runtime Engine in your local machine are not required. You can pull Docker Image for Katalon Studio at Docker Hub: katalonstudio/katalon.
Integrate with Docker on Jenkins
To integrate with Docker on Jenkins, you need to install the Docker Plugins and Docker Pipeline, then set an environment path to Jenkins. Do as follows:
Install plugins
-
Open Jenkins, then go to Dashboard > Manage Jenkins > Manage Plugins.
-
The Plugin Manager page appears. In the Available tab, search for Docker Plugin and Docker Pipeline, then select them.
-
Click Install without restart.
Add an Environment Path
To run Docker commands from Jenkins, you need to add an environment path to Jenkins. The PATH
specifies where to find the folder containing Docker commands.
Go to Dashboard > Manage Jenkins > Configure System > Global properties. Select the Environment variables to add a global variable named PATH
with this value: $PATH:/usr/local/bin:
.
Upload your Katalon project on Jenkins
- Make sure you have Docker open, with Docker Plugin and Docker Pipeline activated on Jenkins.
- You can clone or download our sample CI/CD project at our GitHub repository: CI sample.
You can either upload your Katalon project from a Git repository or your local workspace.
Upload a Git repository
- Prepare your Katalon project repository on GitHub.
-
In the Jenkins Dashboard, go to New Item and create a Freestyle project.
-
In the Source Code Management section, choose Git.
-
Enter your repository URL, select branches to build, repository browser, and additional behaviours, if any.
Upload in the local workspace
- Put your CI/CD project folder in this directory:
Users/Your_user_name/.jenkins/workspace
. Copy your project folder name. - In the Jenkins Dashboard, go to New Item and create a Freestyle project. Name your project the same name as your project folder in your local Jenkins workspace.
Build your project
-
In the Build section, click Add build step and choose Execute shell. Input your command, for example:
docker run -t --rm -v "$(pwd)":/tmp/project katalonstudio/katalon katalonc.sh -projectPath=/tmp/project -browserType="Chrome" -retry=0 -statusDelay=15 -testSuitePath="Test Suites/TS_RegressionTest" -apikey=<YOUR_API_KEY>
Note:You can find more command line options at Command Syntax.
After you are done with the configuration, click Save.
-
In your project, click Build Now.
-
To view the console log, click on your current build on Jenkins and select Console Output.
In the Console Output, you can view the status when Docker starts finding the image
katalonstudio/katalon
, verifying your licenses, reloading plugins, then executing your test. If Docker cannot find thekatalonstudio/katalon
image locally, it automatically pulls this image.
When the test is being run, you can also view this console log in Docker.
-
To view your report files, you can go to this directory:
Users/Your_user_name/.jenkins/workspace/Your_project_name/Reports
or your third-party integration like Katalon TestOps, Azure DevOps, or qTest.Note:-
For real-time monitoring and better reporting capabilities, consider integrating your project with Katalon TestOps. See also Upload Test Results to Katalon TestOps from Katalon Studio.
-