My approach for a similar case is like this:
- once the project is finaly set-up on windows, I push it to git (and remove some files not needed, like libs directory and so on)
- from Jenkins, grab the project and run it using the docker image on a linux executor
To achieve this, i do as follows:
- in the Source Code management I set up the repo where my project is pushed
- next, i am setting up some environment variables, using the “inject environment variables” plugin > groovy script. the code I put in there looks like this
def TODAY = new Date().format('YYYY_MM_dd')
def REPORT_DIR = "${TEST_SUITE_NAME}_${TEST_ENV}_${TODAY}.${BUILD_NUMBER}"
def TS_PATH = "Test\\ Suites/TS_$TEST_SUITE_NAME"
def katalon_opts = "-browserType='Chrome' -retry=0 -statusDelay=15 -consoleLog -testSuitePath=$TS_PATH -executionProfile=$TEST_ENV"
return [
katalon_opts: katalon_opts,
REPORT_DIR : REPORT_DIR
]
This is not mandatory, those variables can be defined straight in the execute shell step or simply not used (use the codes straight in the cmd, skip what is not needed for you)
The ${TEST_SUITE_NAME} and ${TEST_ENV} variables are set in the “This project is parametrized” section part, since I want to execute this job with different scenarios (suites and predefined profiles) and I want also the report to be generated into a custom named folder (at the end of the execution I am uploading the html one to an apache server, but that part is a different story)
-next, into an “execute shell” step, I have a script like this:
mkdir $REPORT_DIR
docker run --rm --name katalon \
-v $(pwd)/path_to_project:/katalon/katalon/source:ro \
-v $(pwd)/$REPORT_DIR:/katalon/katalon/report \
-e KATALON_OPTS="$katalon_opts" katalonstudio/katalon:5.7.0
replace the “path_to_project” to your case, depending how is set into your VCS.
also you can simply use the katalonstudio/katalon without specifying the version tag, if you want to always use the latest docker image.
That’s all. Hope it helped!