Is it possible to rename default "Declarative: Checkout SCM" step?
Asked Answered
H

1

26

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.

Hardan answered 5/7, 2017 at 14:3 Comment(1)
I am looking for renaming only, have you found any solution?Lailaibach
H
44

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
...
Hardan answered 7/7, 2017 at 14:26 Comment(2)
@Hardan this saved me lot's of time! My problem was that some nodes may not checkout the repo per default, because they can't.Camus
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.Camus

© 2022 - 2024 — McMap. All rights reserved.