our project structure has been split. On the one hand there is the /plugins folder containing all main plugin projects. On the other hand we have a /tests folder containing all the fragment projects that are the unit tests for their corresponding main plugin projects.
Jenkins lets me check out multiple repositories, and even to the same folder in the workspace.
The problem is that the first checkout is deleted when the second URL is checked out.
/plugins is placed into the workspace directory, then the workspace directory is "cleaned":
Cleaning local Directory .
Then the second directory /tests is checked out.
Of course I want that both folder contents are placed in the same workspace directory. How can I do that?
There is also a Jenkins Repo plugin that allows to checkout all or part of the repositories managed by git-repo to the same Jenkins job workspace. Thanks for contributing an answer to Stack Overflow!
create a different repository entry for each repository you need to checkout (main project or dependancy project. for each project, in the "advanced" menu (the second "advanced" menu, there are two buttons labeled "advanced" for each repository), find the "Local subdirectory for repo (optional)" textfield.
As a workaround, you can either have multiple upstream jobs which checkout a single repo each and then copy to your final project workspace (Problematic on a number of levels), or you can set up a shell scripting step which checks out each needed repo to the job workspace at build time.
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). We are using Jenkins v1.645 and the git SCM will out-of-the-box do a recursive clone for superprojects.
Assuming you're using Subversion to checkout your projects, you need to specify the "Local module directory" to something other than the default for each path you are checking out.
For example;
If you have svn://myrepo/myproject/plugins and svn://myrepo/myproject/tests, the configuration would be along the lines of;
Modules: Repository URL : svn://myrepo/myproject/plugins Local module directory (optional) : plugins Repository URL : svn://myrepo/myproject/tests Local module directory (optional) : tests
This would then inform Jenkins that it has two paths to checkout and into separate locations.
If you are trying to checkout a project into the subfolder of another working copy, you may have to use svn:externals on the parent directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With