Testkube Jenkins Pipelines
The Testkube Jenkins integration streamlines the installation of Testkube, enabling the execution of any Testkube CLI command within Jenkins pipelines. This integration can be effortlessly integrated into your Jenkins setup, enhancing your continuous integration and delivery processes. This Jenkins integration offers a versatile solution for managing your pipeline workflows and is compatible with both commercial and open source deployments of Testkube. It allows Jenkins users to effectively utilize Testkube's capabilities within their CI/CD pipelines, providing a robust and flexible framework for test execution and automation.
Testkube CLI Jenkins Plugin
Install the Testkube CLI plugin by searching it in the "Available Plugins" section on Jenkins Plugins, or using the following url: https://plugins.jenkins.io/testkube-cli
Testkube
How to configure Testkube CLI action for Testkube and run a Test Workflow
To use Jenkins CI/CD with Testkube, you need to create an API token. Then, pass the organization and environment IDs, along with the token and other parameters specific for your use case.
If a test is already created, you can run it using the command testkube run testworkflow TEST_WORKFLOW_NAME -f
. However, if you need to create a test in this workflow, please add a creation command, e.g.: testkube create testworkflow -f EXAMPLE_FILE.yaml
.
You'll need to create a Jenkinsfile. This Jenkinsfile should define the stages and steps necessary to execute the workflow
pipeline {
agent any
environment {
TK_ORG = credentials("TK_ORG")
TK_ENV = credentials("TK_ENV")
TK_API_TOKEN = credentials("TK_API_TOKEN")
}
stages {
stage('Example') {
steps {
script {
// Setup the Testkube CLI
setupTestkube()
// Run testkube commands
sh 'testkube run testworkflow TEST_WORKFLOW_NAME -f'
}
}
}
}
}