On Sat, Nov 10, 2018 at 12:12 PM Martin Weber <
enten...@gmx.de> wrote:
> Pipeline offers a *different* way of checking out multiple
> SCMs. With the same branch seen in several SCMs, Pipeline only checks out the
> branch from the *first SCM* only.
>
> In contrast, Multiple SCMs Plugin checks out a branch from *each SCM* in
> parallel.
Daniel’s response, as well as the phrasing of the initial question,
are mixing up two very different things: multibranch projects and
plain projects. `multiple-scms` addresses a limitation in plain
(freestyle) projects that you could not have multiple SCM checkouts in
your workspace. This is trivially addressed in (plain) Pipeline
projects simply by doing something like
dir('first-repo') {
git '
http://git/first-repo'
}
dir('second-repo') {
git '
http://git/second-repo'
}
In other words, you may run the `checkout` step (or sugar like the
`git` step) one time, zero times, a hundred times, with whatever
arguments you want, in whatever locations you want; there is no need
for a special plugin to work around a limited model.
Your question implied that you were thinking about branch sources in a
multibranch project folder configuration, something quite unrelated to
multiple checkouts in a single build. In the rare case that more than
one is specified, a given branch project is loaded from just one
source—the first to claim its name. `checkout scm` uses that source.
The `resolveScm` step is for use from multibranch Pipelines with
multiple checkouts, and does not correspond to anything in freestyle
projects. I cannot answer any detailed questions about its behavior as
I am not its author, though from its description¹ it sounds like it
already supports the mode you describe, given suitable arguments. The
PR which added it² had no review. I think the feature would have
better placed in a separate plugin where it could be put up for
adoption, as it manages an advanced use case and I doubt the
maintainers of core Pipeline functionality have the time to deal with
it.
I hope this clears up the use case for which the `multiple-scms`
plugin was created, and why its use is discouraged as of the advent of
Pipeline.
¹ Pending formatting fixes to the static site, a live rendering such
as
https://ci.jenkins.io/pipeline-syntax/html may be more usable.
²
https://github.com/jenkinsci/workflow-multibranch-plugin/pull/46