AlanRicker
AlanRicker

Reputation: 11

Build Name Setter before SCM on Jenkins

I'm using Build Name Setter plugin on Jenkins and it works great. I'm running latest Jenkins version (2.73.1)

The only problem is that I want it to set the build name before the SCM runs as my SCM operation itself can take 20 minutes and I want to see the build name before then. It currently only runs after SCM and before actual build steps.

Is there a way to run the plugin before SCM or is there an alternative method to setting the build name in a pre-SCM build step?

Upvotes: 0

Views: 134

Answers (1)

question_maven_com
question_maven_com

Reputation: 2475

pipeline {
    agent any

    stages {
        stage('init'){
            steps {
                script {
                    currentBuild.displayName = "#${BUILD_NUMBER}, blablaaaa1"
                    currentBuild.description = "#${BUILD_NUMBER}, blablaaaa2"
                }
            }
        }
        stage('Git') {
             steps {
                echo "git ..."
             }
        }
    }
}

Upvotes: 1

Related Questions