Run Katalon on Jenkins with Kubernetes


#1

Has anybody implemented Katalon on kubernetes so far?

I’m struggling to get Katalon to run on Jenkins via Kubernetes currently.

What I currently have:

#!/usr/bin/env groovy

serviceName = ‘testingWithKatalon’
def uuid = UUID.randomUUID().toString() // used to make pod labels unique
def buildNumber = env.BUILD_NUMBER
String podTemplateConcat = “${serviceName}-${buildNumber}-${uuid}”
String podTemplateLabel = “”

if (podTemplateConcat.length() > 63) {
podTemplateLabel = podTemplateConcat.substring(0,63)
} else {
podTemplateLabel = podTemplateConcat
}

podTemplate(
name: “${podTemplateLabel}”,
label: “${podTemplateLabel}”,
namespace: ‘tools’,
containers: [
containerTemplate(name: ‘jnlp’, image: ‘jenkins/jnlp-slave:3.27-1’, args: ‘${computer.jnlpmac} ${computer.name}’),
containerTemplate(name: ‘docker’, image: ‘docker’, command: ‘cat’, ttyEnabled: true),
containerTemplate(
name: ‘katalon’,
image: ‘katalonstudio/katalon:latest’,
ttyEnabled: true,
command: ‘cat’
)
],
volumes: [
hostPathVolume(hostPath: ‘/data/volumes/tools/.m2/repository’, mountPath: ‘/home/jenkins/.m2/repository’),
hostPathVolume(hostPath: ‘/var/run/docker.sock’, mountPath: ‘/var/run/docker.sock’),
hostPathVolume(hostPath: ‘/katalon/katalon/source’, mountPath: ‘/katalonjenkinsdockertest’),
configMapVolume(configMapName: ‘jenkins-web’, mountPath: ‘/var/jenkins_config/’),
]){
node("${podTemplateLabel}") {
stage(‘Test’) {
println “Start of stage: test "
try {
container(‘katalon’) {
println “Execute katalon container”
sh 'katalon-execute.sh -noSplash -runMode=console -consoleLog -noExit -browserType=“Chrome” -retry=0 -statusDelay=15 -testSuitePath=”/Test Suites/Test1" ’
}
}
catch (exc) {
println “Failed to test - ${currentBuild.fullDisplayName}”
throw(exc)
}
}
post {
always {
archiveArtifacts artifacts: ‘report//.’, fingerprint: true
junit 'report/
/JUnit_Report.xml’
}
}
}
}


#2

Search is your friend (hopefully)

https://forum.katalon.com/search?q=Kubernetes