Hello,
I use a seperate reopsitory for my pipeline script. Multiple Jenkins Jobs use this pipeline script to built different Projects. For better
maintainability the pipeline itself
consists of a main script and multiple other sript files in which I implemented the different stages.
The pipelines are started by the built in function of Jenkins to checkout a Pipelinescript from SCM. Here I have configured the main pipeline script to be run. This main script then uses "load" to start the different stages.
The thing that annoys me is that the "load" command needs to be contained inside a node {..} block. This means I have to checkout the script files again on a node to "load" it. The scripts are already checked out on the master after "loading the script from SCM". I simply want to use the Flyweight executor to run the content of the stage script). A bad solution would be to have the whole pipeline in one big script file. This would work but is really confusing.
Is there a way to tell the main script (which runs on the master) to "insert" another groovy file (already present on master)?
Any Ideas?
Thanks
Chris
Note:
In the Pipeline documentation I
found the following but this still needs to checkout the scripts to a
new node every time I want to load something.
node {
git '…'
load 'pipeline.groovy'
}()
Ok, I could dedicate a single node like node('pipelineControl') so the scripts have to be be checked out only once but this solution still doesn't convince me.