Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I override the "part of app-pipeline" buildname?

We are migrating a set of jobs (concerning the same codebase) to a pipeline. The main reason for the split into multiple jobs was the achieved parallelism and finegrained return-values. The pipeline/Jenkinsfile-approach seems to be a good fit. Some plugins are still missing but all in all we're on a good track.

One of the things that we are missing, is the good naming we had before. Before, each build would get a name like $jobname $buildnumber ($branch), which gave us app-spec #42 (new-feature). This lead to nice visibility in the jenkins "executor status"-sidebar.

With the pipeline, we only get part of app-pipeline #23, which forces us to look into the build and determine what is running at any given moment in time.

Is there a way to override the name that is shown in the sidebar?

UPDATE

I mostly want the answer to "what part of the parallelized pipeline is running in that executor".

like image 835
kronn Avatar asked Jun 14 '16 12:06

kronn


People also ask

Where is Jenkins pipeline script stored?

As mentioned above, unlike Jenkinsfile s you define through Blue Ocean (above) or in source control (below), Jenkinsfile s entered into the Script text area area of Pipeline projects are stored by Jenkins itself, within the Jenkins home directory.

How do I export Jenkins pipeline script?

Create a project on JenkinsEnter function-export-example as name, select Pipeline , and click OK . In the newly created project, click Configure to set up. In the Pipeline section, select Pipeline script from SCM as Definition , Git as SCM , and your repo url as Repository URL . Click Save at the bottom.

How do I get Jenkinsfile from Jenkins?

Copy one of the examples below into your repository and name it Jenkinsfile. Click the New Item menu within Jenkins. Provide a name for your new item (e.g. My-Pipeline) and select Multibranch Pipeline. Click the Add Source button, choose the type of repository you want to use and fill in the details.


1 Answers

Put a stage('name'){} block in each parallel entry. The name of the stage will appear in the executor status. So name your stages whatever you want to see in the status.

Note, the "part of ..." label will still show in the build queue, but executor status will show correctly.

parallel (     'newOne': { stage('new-feature'){ //all the things } },     'second': { stage('second branch'){ //all the things } },     'third': { stage('third branch'){ //all the things } }, )   

The executor will show

jobname #nnn (new-feature)  jobname #nnn (second branch) jobname #nnn (third branch) 

EDIT: I ran a test pipeline that is simulating a multiconfig job with 3 axes: OS, JDK Fruit. Each branch of the config combinations runs in parallel and has a named branch. The executor status indicates each combination running:

enter image description here

like image 130
Rob Hales Avatar answered Oct 15 '22 03:10

Rob Hales