Checkout multiple git repos into same Jenkins workspace

后端 未结 9 1609
谎友^
谎友^ 2020-11-28 04:42

Using Jenkins 1.501 and Jenkins Git plugin 1.1.26

I have 3 different git repos each with multiple projects.

Now I need to checkout all projects from the 3 gi

9条回答
  •  再見小時候
    2020-11-28 04:58

    Depending upon the relationships of the repositories, another approach is to add the other repository (repositories) as a git submodules to one of the repositories. A git submodule is creates a reference to the other repos. Those submodule repos are not cloned unless the you specify the --recursive flag when cloning the "superproject" (official term).

    Here's the command to add a submodule into the current project:

    git submodule add

    We are using Jenkins v1.645 and the git SCM will out-of-the-box do a recursive clone for superprojects. Voila you get the superproject files and all the dependent (submodule) repo files in their own respective directories in the same Jenkins job workspace.

    Not vouching that this is the correct approach rather it's an approach.

提交回复
热议问题