A pipeline job configuration has references to two kinds of URLs:
- Repository location that contain the pipeline script
- Repository location that contain other files. No script but files used during build process.
The current version of Jenkins/Pipeline makes no difference. Because of this, all the repository locations are checked out 2 times:
- First, all is checked out in the JobName@script folder
- Second, all is checked out again in JobName folde
Usually the repository location containing the script contains few and small files. However, the rest of the repository locations contain many files and folder and takes a long time to checkout / update. This leads to a longer time to build.
The time to build could be improved by checking out at the beginning only the repository location that contains the script (in the JobName@script folder) . An additional parameter in the configuration must be added to identify which URL(s) contains the script. The other repository locations should be checked out only once in the workspace folder (JobName folder)