Hello everyone, I’m still new to Jenkins and need your help.
We use freestyle jobs. We want to create an Msbuild job in Jenkins. To do this, we access a remote repository in Gitlab. This repository contains a project that contains various libraries as references. A separate Gitlab repository was created for each library. We have checked out the entire Gitlab directory locally and the required references are found.
Question: How can I create a Jenkins MsBuild job that accesses the main project in gitlab and includes the required other repositories as references so that the Msbuild process runs successfully. We downloaded the Git plugin and tried the “Check out to a subdirectory” function, but without success. Would it be possible to solve this problem without a pipeline or script using just the Jenkins Gui and plugins?
freestyle jobs allow checking out only a single repository. There is a plugin that allows to checkout multiple scms, but it is marked as deprecated (last release 3 years ago).
You can also add additional shell or bat steps where you do the checkout yourself.
You should really consider switching to pipelines. You don’t need to use a Jenkinsfile for pipeline jobs, you can also define the script inline in the job. With this setup the difference is not so big to a freestyle job. You can use the snippet generator to define your steps and then just copy it into your script. Creating a complexer logic in freestyle is possible but it is really a pain and some things are just not possible at all, while in pipeline it is just like writing code.
Although using a Jenkinsfile usually is better as it means the file is under version control so you can easily test changes.