If you have a Jenkins instance you’re sharing with other developers, it can be quite hard to find your jobs. By default, Jenkins names your jobs as: #${BUILD_NUMBER} and adds the date and time of execution. When you work with other team members, your history will look something like this: 

Find your Jenkins pipeline faster

Unless you know exactly which build was yours or the time you ran this job, it will take some clicking back and forth to find your job. Using two plugins, you can make your life much easier.

First, the Build Name and Description Setter plugin allows you to set the build name and description. Second, the build user vars plugin extends your options with user variables which we will use. 

Changing a build name and description can be easily done in Jenkins GUI job configuration. In the Build Environment section, set Build name to: #${BUILD_NUMBER} ${BUILD_USER}. If you’d like to make your history a bit more descriptive, you can add a description with your TARGET_SYSTEMparameter: TARGETSYSTEM: ${TARGET_SYSTEM}. Now, it will be much easier to find your job. Of course TARGET_SYSTEM is not a Jenkins built in variable but in this context it is used to define a specific environment on which jobs are running. If you are using any other variable for this specific purpose, you can use it here.

This will work for Freestyle projects. However, if you’re using pipelines like most people do, you can add this as a step in your Jenkinsfile:

stage('Add Build Description'){
    steps {
        wrap([$class: 'BuildUser']) {
            buildName "#${BUILD_NUMBER} ${BUILD_USER}"
            buildDescription 'TARGETSYSTEM: ${TARGET_SYSTEM}'
        }
    }
}

 


“Find your Jenkins pipeline faster” Tech Bite was brought to you by Kenan Ibrović, DevOps Engineer at Atlantbh.

Tech Bites are tips, tricks, snippets or explanations about various programming technologies and paradigms, which can help engineers with their everyday job.

Protractor parallel execution
QA/Test AutomationTech Bites
May 12, 2023

Protractor parallel execution

Why Parallel Testing? When designing automation test suites, the ability to run tests in parallel is a key feature because of the following benefits: Execution time - Increasing tests efficiency and, finally, faster releases Device compatibility - There are many devices with various versions and specifications that need to be…
Introduction to GraphQL
QA/Test AutomationTech Bites
May 11, 2023

Introduction to GraphQL

In today's Tech Bite topic, we will get familiar with GraphQL and explain its growth in popularity in recent years as the new standard for working with APIs. What is GraphQL? GraphQL stands for Graph Query Language. It is an API specification standard and, as its name says - a…
IQR in Automation Testing
QA/Test AutomationTech Bites
April 25, 2023

IQR in Automation Testing: Unleashing the Data Analytics Potential

Usually, when people talk about statistics, they think only about numbers, but it is much more.  Statistics is an irreplaceable tool in different fields like data analysis, predictive modeling, quality control, scientific research, decision-making models, etc. Overall, statistics provide a valuable toolset for understanding, describing, and making predictions about data,…

Leave a Reply