Fixed
Details
Assignee
Barak KorrenBarak Korren(Deactivated)Reporter
Barak KorrenBarak Korren(Deactivated)Blocked By
Code reviewComponents
Priority
Medium
Details
Details
Assignee
Barak Korren
Barak Korren(Deactivated)Reporter
Barak Korren
Barak Korren(Deactivated)Blocked By
Code review
Components
Priority
Created May 23, 2017 at 4:20 PM
Updated July 2, 2017 at 2:08 PM
Resolved June 14, 2017 at 12:53 PM
The pipeline loader, used to load pipeline scripts from the Jenkins repo is missing a couple of useful features:
It takes on a node and keeps it. If the pipelines are long, the node is kept for the whole time even if its not used. It would be a useful optimization to let pipeline scripts specify code that runs without the node.
It is impossible to access functions that are defined in the loader from the pipeline scripts.
The following solution is offered to provide both features:
We will change the loader to look for a "
loader_main
" function in the pipeline script. If it exists it will call it passing itself as an argument. This way that function will get access to function in the loader and can store them for use by other functions.If a "
main
" function exists in the pipeline script in addition to the "loader_main
" function, if will be called outside of the "node
" block in the loader. This way we can run code in "main
" that does not need the loader node.If a "
loader_main
" function will not exist in a pipeline, the "main
" function will be called from inside the "node
" block, like it is today. This way we maintain compatibility with existing pipeline scripts.