laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/32940 )
Change subject: contrib/jenkins: create workspace.tar.xz on error ......................................................................
contrib/jenkins: create workspace.tar.xz on error
In order to figure out why we sometimes get a coredump in the jenkins master jobs, add a quick hack to get all relevant binaries on libraries on error.
Related: OS#5665 Change-Id: I1439c06316edbe11f162c14774c2d507152b97a7 --- M contrib/jenkins.sh 1 file changed, 28 insertions(+), 2 deletions(-)
Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 4380f16..f9d944a 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -4,8 +4,20 @@ # environment variables: # * WITH_MANUALS: build manual PDFs if set to "1" # * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1") +# * IS_MASTER_BUILD: set to 1 when running from master-builds (not gerrit-verifications) #
+exit_tar_workspace() { + cat-testlogs.sh + + if [ "$IS_MASTER_BUILD" = "1" ]; then + tar -cJf "/tmp/workspace.tar.xz" "$base" + mv /tmp/workspace.tar.xz "$base" + fi + + exit 1 +} + if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" exit 2 @@ -68,11 +80,11 @@ ./configure --enable-sanitize --enable-external-tests --enable-werror $CONFIG $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ - || cat-testlogs.sh + || exit_tar_workspace LD_LIBRARY_PATH="$inst/lib" \ DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests --enable-werror $CONFIG" \ $MAKE $PARALLEL_MAKE distcheck \ - || cat-testlogs.sh + || exit_tar_workspace
if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then make -C "$base/doc/manuals" publish