How to store Jenkins Pipeline Global Libraries in RTC
The Jenkins Pipeline functionality allows for retrieving "global libraries" from an SCM and making them available to any of the pipelines defined.
FATAL: RTC : checkout failure: A snapshot with name "Jenkins Groovy Libraries ${library.LIBNAME.version}" is not associated with the workspace "BUILD - Jenkins Pipeline Groovy Libraries WS". FATAL: RTC : checkout failure: RTC : checkout failure: A snapshot with name "Jenkins Groovy Libraries ${library.LIBNAME.version}" is not associated with the workspace "BUILD - Jenkins Pipeline Groovy Libraries WS". hudson.AbortException: RTC : checkout failure: A snapshot with name "Jenkins Groovy Libraries ${library.LIBNAME.version}" is not associated with the workspace "BUILD - Jenkins Pipeline Groovy Libraries WS".As you can see, the RTC plugin is using the variable string format, and not an expanded variable string. It's not clear to me why this is not being expanded, except to assume that the RTC plugin never sends these parameters to Jenkins for variable expansion. So, is there a way to utilize Jenkins Pipeline Global Libraries and the RTC plugin (maybe loading a Workspace Snapshot isn't the best way)? Or maybe this is an error in the Jenkins RTC Plugin. For now, I am stuck with only one specific version of my libraries and I have to hard-code the snapshot into the Global Jenkins settings (so I cannot use different versions with different Jobs). I am using the latest Jenkins, Jenkins plugins, and RTC plugin available today: Jenkins 2.89.4 LTS and TeamConcert Plugin 1.2.0.4. My RTC server is at 6.0.4 (I don't control this and cannot make changes to it). Thanks. |
One answer
Hi Nathan
If you are using snapshot (associated with a workspace), then the snapshot names should be version numbers like 1.0, 2.0 etc., In the snapshot field of RTC SCM configuration, you have to put ${library.<yourlibraryname>.version}, where <your library name> is the name of the GSL. This will expand to the version number that is specified as default. If you use the @Library annotation with a version number at the end, then the property will expand to that specific version number. A snapshot whose name matches that version number should exist in the repository workspace.
Comments
Lakshmi Narasimhan T V
commented Mar 16 '18, 6:42 a.m.
| edited Mar 16 '18, 6:42 a.m.
JAZZ DEVELOPER
A snapshot field value like the following
Jenkins Groovy Libraries - ${library.<yourlibraryname>.version} should resolve to Jenkins Groovy Libraries - 1.0. Currently Team Concert Plugin cannot resolve a property inside a string in the snapshot field, it only deferences if the field just has a property reference and nothing else. I have created a work item 454942 in jazz.net to fix this.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.