22

When you use Jenkins multibranch pipeline, the first stage is named by default Declarative: Checkout SCM.

Is it possible to rename it? I know that it is possible to skip default checkout, but I do not want this - I just want to rename this default step.

Basil
  • 981
  • 1
  • 8
  • 20

1 Answers1

40

Since noone posted a better solution, I just did it this way:

...
options {
    skipDefaultCheckout(true)
}
stages {
    stage('However I want to name a stage') {
        steps {
            checkout scm
...
Alex Tartan
  • 6,736
  • 10
  • 34
  • 45
Basil
  • 981
  • 1
  • 8
  • 20
  • @Basil this saved me lot's of time! My problem was that some nodes may not checkout the repo per default, because they can't. – Cutton Eye Dec 05 '17 at 14:38
  • Some other struggeling with SCM might check the hook in the options called `[ ] Lightweight checkout` in pipeline configuration which decides if the full repro is checked out or only the Jenkinsfile is used. – Cutton Eye Dec 05 '17 at 14:46