Reputation: 313
Is it possible to use a variable in the repository url for the jenkins git plugin?
https://${GIT_USER}@github.com/e82eric/Prompts.git
When I try it looks like ${GIT_USER}
is passed instead of the substitution.
Upvotes: 12
Views: 7510
Reputation: 1278
BEST SOLUTION - 100% works
First place the entire Repository url with no variables under Environment variables. Example: Let's say i want to put https://[email protected]/ero/myProject under Repostiory Url in Pipeline from scm Dashboard -> Manage Jenkins -> Configure the System -> Environment variables Click on Add
Now go to the Repository Url and place ${RepoUrl} there
Finally (Important step)
Uncheck the Lightweight checkout at the bottom
Build It -> Success
Upvotes: 2
Reputation: 4075
According to the Jenkins Git-Plugin page, this should be working by now (Feb-2015).
Among the issues that were resolved:
Upvotes: 2
Reputation: 24617
As noted above:
It looks like this issue has been filed many times over the course of the past few years and they never "accepted" a fix. There have been fixes but the admins closed the issue as "Won't fix".
References
Upvotes: 0