From 1b4745847baffc5f449241afbc8145f07330eafd Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Mon, 8 Nov 2021 23:17:17 -0300 Subject: [PATCH] Attempt to fix Jenkins build script exit code issue --- .jenkins/Jenkinsfile | 2 +- .jenkins/build.sh | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile index aa084ef49..a1b24438d 100644 --- a/.jenkins/Jenkinsfile +++ b/.jenkins/Jenkinsfile @@ -23,7 +23,7 @@ def gitClone() { } def windowsBuild() { - bat 'C:\\msys64\\msys2_shell.cmd -msys2 -defterm -here -no-start -c .jenkins/build.sh' + bat 'C:\\msys64\\msys2_shell.cmd -msys2 -defterm -here -no-start -c "exec .jenkins/build.sh"' } def unixBuild() { diff --git a/.jenkins/build.sh b/.jenkins/build.sh index 321e17fa4..c78f56ee8 100644 --- a/.jenkins/build.sh +++ b/.jenkins/build.sh @@ -208,12 +208,13 @@ EOF arm32) local cmake_flags_extra="$cmake_flags_extra -D NEW_DYNAREC=ON -D ARCH=arm";; arm64) local cmake_flags_extra="$cmake_flags_extra -D NEW_DYNAREC=ON -D ARCH=arm64";; # no dynarec - *) local cmake_flags_extra="$cmake_flags_extra -D DYNAREC=OFF";; # no dynarec + *) local cmake_flags_extra="$cmake_flags_extra -D DYNAREC=OFF";; esac # Run CMake. - echo [-] Running CMake - cmake -G "Unix Makefiles" $cmake_flags $cmake_flags_extra -D BUILD_TYPE="$BUILD_TYPE" -D EMU_BUILD="$build_qualifier" -D EMU_GIT_HASH="$git_hash" . + cmake_flags_extra="$cmake_flags_extra -D BUILD_TYPE=\"$BUILD_TYPE\" -D EMU_BUILD=\"$build_qualifier\" -D EMU_GIT_HASH=\"$git_hash\"" + echo [-] Running CMake with flags [$cmake_flags $cmake_flags_extra] + cmake -G "Unix Makefiles" $cmake_flags $cmake_flags_extra . local status=$? if [ $? -gt 0 ] then @@ -333,7 +334,7 @@ EOF # All good. echo [-] Build of [$job_name] [$build_number] [$git_hash] for [$arch] with flags [$cmake_flags] successful - job_exit=0 + export job_exit=0 } # Set common variables. @@ -444,8 +445,11 @@ case $JOB_BASE_NAME in ;; *) - echo Error: unknown job name $JOB_BASE_NAME + echo [!] Unknown job name $JOB_BASE_NAME exit 1 ;; esac + +echo +echo [-] Exiting with code [$job_exit] exit $job_exit