Jenkins
How can you use Kubiya to trigger Jenkins jobs, pull build status or logs
What is Jenkins
Jenkins is an open source continuous integration/continuous delivery and deployment (CI/CD) automation software DevOps tool. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and delivery. It is a server-based system that runs in servlet containers such as Apache Tomcat.
Things you can do using Kubiya
- Trigger jobs including setting valuables dynamically
- Get build status
- Push notifications or logs to specific channels
How to Integrate Jenkins into Kubiya
- 1.Deploy the Jenkins action store and define the environment variables for the Jenkins user email and instance URL: JENKINS_USER and JENKINS_URL.
- 2.Create a secret named "JENKINS_PASSWORD" with the password for your Jenkins account.
- 3.Test the integration by using Kubiya's commands or conversational prompts to trigger jobs, check build status, and receive Jenkins notifications or logs.
By following these steps, you can seamlessly automate CI/CD processes, monitor Jenkins builds, and receive notifications using Kubiya as the bridge.
Action store reference
Reach out to your Kubiya engineer for a complete list of actions.
Sample actions
build_job(params: dict)
This function is used to trigger a build for a Jenkins job. It makes an API call to the Jenkins endpoint for building the specified job. The function takes the job name as a parameter and optionally additional parameters for parameterized jobs. It returns a message indicating the job name and the provided parameters.
Parameters:
params (dict): A dictionary containing the following keys:
'job_name' (required): The name of the Jenkins job to be built.
Additional parameters for parameterized jobs (optional).
get_jenkins_logs(params: dict)
This function is used to retrieve the console logs of a Jenkins job. It makes an API call to the Jenkins endpoint for retrieving the console text of the specified job. The function takes the job name and the Jenkins build number as parameters. It returns the console logs as a response.
Parameters:
params (dict): A dictionary containing the following keys:
'job_name' (required): The name of the Jenkins job.
'jenkins_number' (required): The build number of the Jenkins job.
Last modified 4mo ago