Jenkins git commit presentation fixes
This commit is contained in:
2
.ci/Jenkinsfile
vendored
2
.ci/Jenkinsfile
vendored
@@ -96,7 +96,7 @@ def gitClone(repository, branch) {
|
|||||||
if (env.GIT_COMMIT == null) {
|
if (env.GIT_COMMIT == null) {
|
||||||
/* Save the current HEAD commit. */
|
/* Save the current HEAD commit. */
|
||||||
env.GIT_COMMIT = scmVars.GIT_COMMIT
|
env.GIT_COMMIT = scmVars.GIT_COMMIT
|
||||||
} else {
|
} else if (env.GIT_COMMIT != scmVars.GIT_COMMIT) {
|
||||||
/* Checkout the commit read from the polling log. */
|
/* Checkout the commit read from the polling log. */
|
||||||
if (isUnix())
|
if (isUnix())
|
||||||
sh "git checkout ${env.GIT_COMMIT} || exit 0"
|
sh "git checkout ${env.GIT_COMMIT} || exit 0"
|
||||||
|
@@ -297,6 +297,7 @@ esac
|
|||||||
|
|
||||||
# Add git hash and copyright year.
|
# Add git hash and copyright year.
|
||||||
git_hash=$(git rev-parse --short HEAD 2> /dev/null)
|
git_hash=$(git rev-parse --short HEAD 2> /dev/null)
|
||||||
|
[ -z "$git_hash" ] && git_hash=$(echo $GIT_COMMIT | cut -c 1-8)
|
||||||
[ ! -z "$git_hash" ] && cmake_flags_extra="$cmake_flags_extra -D \"EMU_GIT_HASH=$git_hash\""
|
[ ! -z "$git_hash" ] && cmake_flags_extra="$cmake_flags_extra -D \"EMU_GIT_HASH=$git_hash\""
|
||||||
cmake_flags_extra="$cmake_flags_extra -D \"EMU_COPYRIGHT_YEAR=$(date +%Y)\""
|
cmake_flags_extra="$cmake_flags_extra -D \"EMU_COPYRIGHT_YEAR=$(date +%Y)\""
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user