Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update manually commit and branch attributes from jenkins pipeline blueocean

We are using jenkins for manual triggered jobs to deploy some code. Jenkinsfile describing our pipeline is located in a jenkinsfile dedicated repo (not in deployed code repo).

We are using declarative pipeline syntax and shared libraries in our jenkinsfiles.

In BlueOcean interface there are 2 interesting attributes (branch and commit) automatically filled when using plugins to trigger pipelines (like github organization). I'm searching a way to set/update these 2 attributes manually from within the pipeline code for our manual pipelines.

Job description and name can be easily updated using something like :

stage('Set pipeline description'){
    steps {
        script {
            currentBuild.description = "Deploying branch ${branch} on ${targetEnv}"
        }
    }
}

But I didn't find anywhere how to update branch or commit values.

Did anybody try this ?

like image 955
Marc3001 Avatar asked Nov 08 '22 12:11

Marc3001


1 Answers

This issue is reported as bug (see link).

"We are using GitLab web hooks to trigger Jenkins Pipeline project builds on new commit push to GitLab. Build is triggered, CI commit status report is being sent back to gitlab, but can't see branch and commit field in Header-details element."

Please vote on this issue on Jenkins CI website if you want for the issue to be resolved sooner.

like image 145
Uccellino Avatar answered Nov 15 '22 06:11

Uccellino