How to define a Git repository with two remotes in Pipeline DSL?

37 views
Skip to first unread message

Marc Rohlfs

unread,
Feb 6, 2017, 8:32:32 AM2/6/17
to Jenkins Users
Hi there,

how can I define a Git repository with 2 remotes in Pipeline DSL? Unfortunaltely, Multiple SCMs don't seem to work for me, because I need a clone that is connected to two remote repositories. I actually need this to implement an automated sync for a vendor branching.

Any ideas?

Many thanks in advance

Marc

Mark Waite

unread,
Feb 6, 2017, 8:51:51 AM2/6/17
to Jenkins Users
I don't know how to do that with pipeline DSL (though I suspect it is possible).

With a regular pipeline script, you can use the "pipeline syntax" link on a pipeline job definition to choose the "checkout" step.  That step will allow you to define multiple remotes for a single working directory.  You might look at the syntax it generates to see if something similar is allowed for pipeline DSL.

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/ca368d24-4d85-4216-bb19-6d273f94020b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marc Rohlfs

unread,
Feb 6, 2017, 9:50:30 AM2/6/17
to Jenkins Users
Hi Mark,

this does exactly what I need, many thanks. I actually used the "pipeline syntax" link, but I was too much focussed on the "git" step instead of thinking about the checkout step.

Many thanks,

Marc
Reply all
Reply to author
Forward
0 new messages