diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2018-05-15 08:35:52 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2018-05-15 08:36:02 +0000 |
commit | 570af845f1bfca0fa9326a550d769519f97288cd (patch) | |
tree | f5139d0316046f9a8fbb1761dc60f46b0f755a73 /jenkins.sh | |
parent | 80cf879e418ced1dbf3b42496224e6584b09f842 (diff) |
Revert "jenkins-logs.sh: Upload logs during EXIT trap handler."
This reverts commit 95beec124ec5f9bd95d88fd6c00ecd4a0e718dab.
This patch seems to be causing problems: buildfarm jobs are stuck at "exit 0", and then get killed by a Jenkins timeout after 10h.
Change-Id: I4784c61d863d33fa43a89ebf1b39a573c48a7873
Diffstat (limited to 'jenkins.sh')
-rwxr-xr-x | jenkins.sh | 65 |
1 files changed, 24 insertions, 41 deletions
@@ -39,36 +39,6 @@ read_var() grep "^${var}=" "${artifact_list}" | cut -d = -f 2- } -upload_to_logserver() -{ - logs_dir=$(mktemp -d) - - # Copy over the build logs - makelog_list=($(read_var ${user_workspace}/build-artifacts.txt 'log_make_[^=]*')) - if test x"${canadian}" = x"true"; then - makelog_list+=($(read_var ${user_workspace}/canadian-build1-artifacts.txt 'log_make_[^=]*')) - makelog_list+=($(read_var ${user_workspace}/canadian-build2-artifacts.txt 'log_make_[^=]*')) - fi - for makelog in "${makelog_list[@]}"; do - cp ${makelog} ${logs_dir}/ || status=1 - done - - # Copy stdout and stderr output from abe. - cp build.out build.err ${logs_dir}/ || status=1 - if $runtests; then - cp check.out check.err ${logs_dir}/ || status=1 - fi - - xz ${logs_dir}/* || status=1 - scp $logopts ${logs_dir}/* ${logserver}:${basedir}/${dir}/ || status=1 - - rm -rf ${logs_dir} || status=1 - - echo "Uploaded build logs to ${logserver}:$logport:${basedir}/${dir}/ with status: $status" - - exit $status -} - if test $# -lt 1; then echo "ERROR: No options for build!" usage @@ -381,16 +351,6 @@ fi $CONFIG_SHELL ${abe_dir}/abe.sh ${platform} ${change} --checkout all ) 9>${git_reference}.lock -# This creates the path on the remote file server and installs the -# EXIT trap handler. -if test x"${logserver}" != x""; then - # Re-eval $dir as we now have full range of variables available. - eval dir="$logname" - ssh $logopts ${logserver} mkdir -p ${basedir}/${dir} - - trap "upload_to_logserver" EXIT -fi - # Now we build the cross compiler, for a native compiler this becomes # the stage2 bootstrap build. ret=0 @@ -456,7 +416,11 @@ if test x"${manifest}" = x; then echo "ERROR: No manifest file, build probably failed!" fi +# This becomes the path on the remote file server if test x"${logserver}" != x""; then + # Re-eval $dir as we now have full range of variables available. + eval dir="$logname" + ssh $logopts ${logserver} mkdir -p ${basedir}/${dir} if test x"${manifest}" != x; then scp $logopts ${manifest} ${logserver}:${basedir}/${dir}/ fi @@ -516,9 +480,28 @@ if test x"${logserver}" != x"" && test x"${sums}" != x -o x"${runtests}" != x"tr cp ${check} ${logs_dir}/ || status=1 done fi + + # Copy over the build logs + makelog_list=($(read_var ${user_workspace}/build-artifacts.txt 'log_make_[^=]*')) + if test x"${canadian}" = x"true"; then + makelog_list+=($(read_var ${user_workspace}/canadian-build1-artifacts.txt 'log_make_[^=]*')) + makelog_list+=($(read_var ${user_workspace}/canadian-build2-artifacts.txt 'log_make_[^=]*')) + fi + for makelog in "${makelog_list[@]}"; do + cp ${makelog} ${logs_dir}/ || status=1 + done + + # Copy stdout and stderr output from abe. + cp build.out build.err ${logs_dir}/ || status=1 + if $runtests; then + cp check.out check.err ${logs_dir}/ || status=1 + fi + + xz ${logs_dir}/* || status=1 + scp $logopts ${logs_dir}/* ${logserver}:${basedir}/${dir}/ || status=1 rm -rf ${logs_dir} || status=1 - echo "Uploaded test results to ${logserver}:$logport:${basedir}/${dir}/ with status: $status" + echo "Uploaded test results and build logs to ${logserver}:$logport:${basedir}/${dir}/ with status: $status" if test x"${tarsrc}" = xtrue -a x"${release}" != x; then allfiles="$(ls ${user_snapshots}/*${release}*.xz)" |