-
Bug
-
Resolution: Unresolved
-
Minor
-
None
I have been using p4groovy with Jenkins pipelines for a while now, and this is becoming more and more cumbersome.
In order to instantiate a p4 object (to run any sort of p4 command), you must define a workspace which p4groovy attempts to create. There doesn't seem to be a way (that I can tell) to just use an existing workspace.
Here is an example of why this is cumbersome. I have a shared function called `get_latest_change()` which simply runs the command `p4 changes -m1 //depot/...`. This command doesn't need a workspace to run, but since p4groovy seems to require one, I have to manually instantiate a workspace and pass it into the function every time I want to call it (and I need to go to great pains to make sure the ws object I create matches the existing workspace so I don't accidentally change things).
Have you tried 'Static Workspace' or 'Spec File'?
https://github.com/jenkinsci/p4-plugin/blob/master/SETUP.md