Jenkins multibranch checkout

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Jenkins multibranch checkout

Gilad Baruchian
Hi,
I noticed that when the multi branch job finds a branch to build it automatically checks out or updates the branch before it even starts executing it's Jenkinsfile.

This is bad for me because I want to run some commands before the checkout, and only then run the checkout myself in the pipeline script (using scm checkout).
Is there any way to do that?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/df61fe3f-c587-4239-bfa2-853e6e2a6560%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins multibranch checkout

Mark Waite-2
If you're using declarative pipeline, then you need to use an option directive to skipDefaultCheckout.  Refer to https://jenkins.io/doc/book/pipeline/syntax/#options for the syntax.

If you're using scripted pipeline, insert the pre-scm operations before the checkout scm step.

Mark Waite

On Mon, Oct 9, 2017 at 12:51 AM Gilad Baruchian <[hidden email]> wrote:
Hi,
I noticed that when the multi branch job finds a branch to build it automatically checks out or updates the branch before it even starts executing it's Jenkinsfile.

This is bad for me because I want to run some commands before the checkout, and only then run the checkout myself in the pipeline script (using scm checkout).
Is there any way to do that?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/df61fe3f-c587-4239-bfa2-853e6e2a6560%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGJg5EZvtth%2BYdBcxq%2BmH3b4zuKLWw%3DnmSn6wmA72a2PA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.