-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
Jenkins - 2.176
Hi,
We are setting up a Pipeline project to use Jenkinsfile, we have our repository in Azure DevOps and while specifying the name space we would like to give it like 'BUILD_ID-JOB_NAME'. Since we want to use single pipeline to build multiple projects so we want to have unique workspace name. But the above mentioned format is not working, it's unable to resolve the BUILD_ID in workspace name.
Can someone please help to resolve this issue.
Hello! Would it be possible to switch to using a scripted or declarative pipeline? You should be able to invoke the Groovy string interpolation that way.
Here's an example of what my company is doing:
By using the string interpolation we can leave the variable expansion to Jenkins itself rather than the TFS plugin.
If you want to continue using Freestyle jobs, I'm afraid I don't have much of a solution. The TFS plugin only expands a few specific variables for the Workspace name (JOB_NAME, USER_NAME, NODE_NAME). You can find the source code here:
https://github.com/jenkinsci/tfs-plugin/blob/aea4ce0f1fd82668b1ead7e2aade2ffe36a32a10/tfs/src/main/java/hudson/plugins/tfs/util/BuildVariableResolver.java#L32
I could be completely wrong here though, so someone please correct me if I am wrong