-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #508 from jglick/buildEnv
[JENKINS-26100] Supply GitSCM/buildEnv
- Loading branch information
Showing
3 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/resources/hudson/plugins/git/GitSCM/buildEnv.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package hudson.plugins.git.GitSCM; | ||
|
||
def l = namespace(lib.JenkinsTagLib) | ||
|
||
// TODO handle GitSCMExtension.populateEnvironmentVariables somehow, say by optionally including GitSCMExtension/buildEnv.groovy; though GIT_{COMMITTER,AUTHOR}_{NAME,EMAIL} are only overridden by UserIdentity | ||
['GIT_COMMIT', 'GIT_PREVIOUS_COMMIT', 'GIT_PREVIOUS_SUCCESSFUL_COMMIT', 'GIT_BRANCH', 'GIT_LOCAL_BRANCH', 'GIT_URL', 'GIT_COMMITTER_NAME', 'GIT_AUTHOR_NAME', 'GIT_COMMITTER_EMAIL', 'GIT_AUTHOR_EMAIL'].each {name -> | ||
l.buildEnvVar(name: name) { | ||
raw(_("${name}.blurb")) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/resources/hudson/plugins/git/GitSCM/buildEnv.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
GIT_COMMIT.blurb=The commit hash being checked out. | ||
GIT_PREVIOUS_COMMIT.blurb=The hash of the commit last built on this branch, if any. | ||
GIT_PREVIOUS_SUCCESSFUL_COMMIT.blurb=The hash of the commit last successfully built on this branch, if any. | ||
GIT_BRANCH.blurb=The remote branch name, if any. | ||
GIT_LOCAL_BRANCH.blurb=The local branch name being checked out, if applicable. | ||
GIT_URL.blurb=The remote URL. If there are multiple, will be <code>GIT_URL_1</code>, <code>GIT_URL_2</code>, etc. | ||
GIT_COMMITTER_NAME.blurb=The configured Git committer name, if any. | ||
GIT_AUTHOR_NAME.blurb=The configured Git author name, if any. | ||
GIT_COMMITTER_EMAIL.blurb=The configured Git committer email, if any. | ||
GIT_AUTHOR_EMAIL.blurb=The configured Git author email, if any. |