Jenkins: Fix .git being lost across stash/unstash

This commit is contained in:
RichardG867
2021-11-24 21:35:17 -03:00
parent 982e1f808d
commit 58670247b4
2 changed files with 2 additions and 2 deletions

2
.ci/Jenkinsfile vendored
View File

@@ -106,7 +106,7 @@ def gitClone(repository, branch) {
println "[-] Using git commit [${env.GIT_COMMIT}]" println "[-] Using git commit [${env.GIT_COMMIT}]"
/* Stash data and mark it as stashed. */ /* Stash data and mark it as stashed. */
stash name: 'git' stash name: 'git', useDefaultExcludes: false
env.GIT_STASHED = 'true' env.GIT_STASHED = 'true'
} else { } else {
/* Unstash data. */ /* Unstash data. */

View File

@@ -297,7 +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" -a "$CI" = "true" ] && 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)\""