Reputation: 771
I know this isn't a "great question" to be asking, but I cannot seem to find the answer anywhere. I am working with creating NuGet packages and one of the properties I would like to auto-populate is the Project URL. I happened to notice that when configuring a Job in Jenkins and you click on 'GitHub project', a box appears for you to enter the 'Project url'. All my research keeps bringing me to the Repository URL, which isn't what I want and I have tried the following (logical possibilities):
$env:PROJECT_URL
$env:PROJECTURL
$env:GITPROJECTURL
$env:GIT_PROJECT_URL
Does anyone know what environmental variable contains this value?
Upvotes: 0
Views: 811
Reputation: 1870
Jenkins environment URL's for git only contain the following:
GIT_BRANCH
For Git-based projects, this variable contains the Git branch that was checked out for the build (normally origin/master)
GIT_COMMIT
For Git-based projects, this variable contains the Git hash of the commit checked out for the build (like ce9a3c1404e8c91be604088670e93434c4253f03) (all the GIT_* variables require git plugin)
GIT_URL
For Git-based projects, this variable contains the Git url (like [email protected]:user/repo.git or [https://github.com/user/repo.git])
If you want to add more URL's, such as the project URL for a Git project, you can create your own environment variables ($env:MyCustom_Project_URL = "http://whateverIwantittobe.randomtld"
) and reference them within your scripts.
Upvotes: 1