Multibranch Pipeline - inbuilt "Checkout SCM" stage, how to change clone directory?

91 views
Skip to first unread message

Andy Coates

unread,
Nov 5, 2017, 5:56:13 PM11/5/17
to Jenkins Users
Hi,

Multibranch Declarative Pipeline seems to have an inbuilt step "Checkout SCM" that is run before my defined stages that clones the project repo into $WORKSPACE

How do I change that directory it clones into? e.g. $WORKSPACE/repo_name

Thanks!

Mark Waite

unread,
Nov 5, 2017, 8:40:14 PM11/5/17
to jenkins...@googlegroups.com
You may need to use the "skipDefaultCheckout" option, then use an explicit "checkout" inside a "dir" or other directive that will control the checkout directive.

See skipDefaultCheckout in https://jenkins.io/doc/book/pipeline/syntax/

Mark Waite

--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b6823af7-9f33-4699-bf93-ecc832995508%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andy Coates

unread,
Nov 7, 2017, 7:04:54 PM11/7/17
to Jenkins Users
Thanks - definitely helped preventing two checkouts at least!  I guess I was a little surprised there is no options for that initial checkout, but still workable like this.

Andy.
Reply all
Reply to author
Forward
0 new messages