Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a trick to debug shared groovy libraries without pushing?

I'm adding to, and maintaining, groovy files to build a set of repositories - previously they were built with freestyle Jenkins jobs. I support some code in shared libraries and to be honest (mainly for DRY reasons) I want to do that more.

However, the only way I know how to test and debug those library files is to push the changes on a git branch. I know about the "replay" trick to test the main Jenkins file. Is there some approach I've missed to do something similar for library code?

like image 506
johnfo Avatar asked Nov 08 '22 21:11

johnfo


1 Answers

If you set up a job to load the shared library instead of relying on a globally set up shared library (you can have both going, for this particular job), then it is possible to hit "replay" and have all your shared library steps show up as editable files.

This can be helpful in iterative development without a million commits.

EDIT: Here's how that looks on an Organization job in Jenkins.

Organization Job Config

like image 123
Spencer Malone Avatar answered Nov 15 '22 05:11

Spencer Malone