Created
January 27, 2017 11:43
-
-
Save KekSfabrik/fae3845c506b78a5341a739a667327e8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def appendEnvironment(propFile) { | |
/* | |
Workaround for GIT plugin, if unset, set manually here: | |
*/ | |
if (!env.GIT_BRANCH) | |
env.GIT_BRANCH = git('rev-parse --abbrev-ref HEAD').trim() | |
if (!env.GIT_COMMIT) | |
env.GIT_COMMIT = git('rev-parse HEAD').trim() | |
if (!env.GIT_URL) | |
env.GIT_URL = git('config --get remote.origin.url').trim() | |
if (!env.GIT_COMMITTER_NAME || env.GIT_AUTHOR_NAME) { | |
env.GIT_AUTHOR_NAME = git("--no-pager show -s --format='%an'").trim() | |
env.GIT_COMMITTER_NAME = env.GIT_AUTHOR_NAME | |
} | |
if (!env.GIT_COMMITTER_EMAIL || env.GIT_AUTHOR_EMAIL) { | |
env.GIT_AUTHOR_EMAIL = git("--no-pager show -s --format='%ae'").trim() | |
env.GIT_COMMITTER_EMAIL = env.GIT_AUTHOR_EMAIL | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment