summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Baylis <charles.baylis@linaro.org>2017-03-30 15:42:19 +0100
committerCharles Baylis <charles.baylis@linaro.org>2017-04-03 11:20:39 +0100
commit5536388cc102398090ff34c6f564496da5c50d20 (patch)
tree5d16fa7e3f734d30c679384892b14a1713d0f685
parentc7bfd2b5cc5752d2b1a1e01a072b2118adc1bdde (diff)
downloadjenkins-scripts-use-list-artifacts.tar.gz
jenkins.sh: Use abe.sh --list-artifactsuse-list-artifacts
Use --list-artifacts for tarballs, manifests and Abe's logs. Use of find still remains for finding *.sum files from make check. Change-Id: I824eac39e2dbcf7f3ef3cc893b446c4964e29ad4
-rwxr-xr-xjenkins.sh50
1 files changed, 19 insertions, 31 deletions
diff --git a/jenkins.sh b/jenkins.sh
index be67c150..5cbd0443 100755
--- a/jenkins.sh
+++ b/jenkins.sh
@@ -32,6 +32,13 @@ EOF
exit $ret
}
+read_var()
+{
+ local artifact_list=$1
+ local var=$2
+ grep "^${var}=" "${artifact_list}" | cut -d = -f 2-
+}
+
if test $# -lt 1; then
echo "ERROR: No options for build!"
usage
@@ -346,7 +353,7 @@ fi
# Now we build the cross compiler, for a native compiler this becomes
# the stage2 bootstrap build.
ret=0
-$CONFIG_SHELL ${abe_dir}/abe.sh --disable update ${tars} ${releasestr} ${platform} ${change} ${try_bootstrap} --timeout 100 --build all --disable make_docs > build.out 2> >(tee build.err >&2) || ret=$?
+$CONFIG_SHELL ${abe_dir}/abe.sh --list-artifacts build-artifacts.txt --disable update ${tars} ${releasestr} ${platform} ${change} ${try_bootstrap} --timeout 100 --build all --disable make_docs > build.out 2> >(tee build.err >&2) || ret=$?
# If abe returned an error, make jenkins see this as a build failure
if test $ret -gt 0; then
@@ -384,21 +391,8 @@ if $runtests; then
fi
- # This second call to abe.sh will (re)generate the manifest,
- # possibly creating a second one if the two calls to abe.sh take
- # place on different days (e.g. when a build is started shortly
- # before midnight). Delete the second manifest created, as later
- # code cannot cope with 2 manifests. This is safe because both
- # have the same contents, except for the dates supplied to the
- # --pkgversion configure options.
- manifest1="`find ${user_workspace}/_build/builds/ -name destdir -prune -o -name \*manifest.txt -print`"
- mv ${manifest1} ${manifest1}.keep
-
ret=0
- $CONFIG_SHELL ${abe_dir}/abe.sh --disable update ${check} ${tars} ${releasestr} ${platform} ${change} ${try_bootstrap} --timeout 100 --build all --disable make_docs > check.out 2> >(tee check.err >&2) || ret=$?
- manifest2="`find ${user_workspace}/_build/builds/ -name destdir -prune -o -name \*manifest.txt -print`"
- rm ${manifest2}
- mv ${manifest1}.keep ${manifest1}
+ $CONFIG_SHELL ${abe_dir}/abe.sh --list-artifacts check-artifacts.txt --disable update ${check} ${tars} ${releasestr} ${platform} ${change} ${try_bootstrap} --timeout 100 --build all --disable make_docs > check.out 2> >(tee check.err >&2) || ret=$?
# If abe returned an error, make jenkins see this as a build failure
if test $ret -gt 0; then
@@ -424,14 +418,6 @@ else
date=${release}
fi
-# Setup the remote directory for tcwgweb
-xgcc="$(find ${user_workspace} -name xgcc)"
-
-# If we can't find GCC, our build failed, so don't continue
-if test x"${xgcc}" = x; then
- exit 1
-fi
-
# This is the remote directory for tcwgweb where all test results and log
# files get copied too.
@@ -445,7 +431,7 @@ fi
echo "Build by ${requestor} on ${NODE_NAME} with parameters: $orig_parameters"
-manifest="$(find ${user_workspace}/_build/builds/ -name destdir -prune -o -name \*manifest.txt -print)"
+manifest="$(read_var build-artifacts.txt manifest)"
if test x"${manifest}" != x; then
echo "node=${node}" >> ${manifest}
echo "requestor=${requestor}" >> ${manifest}
@@ -492,13 +478,13 @@ sums="$(find ${user_workspace} -name \*.sum -not -path "*/gdb/testsuite/outputs/
# Canadian Crosses are a win32 hosted cross toolchain built on a Linux
# machine.
if test x"${canadian}" = x"true"; then
- $CONFIG_SHELL ${abe_dir}/abe.sh --disable update ${change} ${platform} --build all
+ $CONFIG_SHELL ${abe_dir}/abe.sh --list-artifacts canadian-build1.txt --disable update ${change} ${platform} --build all
distro="$(lsb_release -sc)"
# Ubuntu Lucid uses an older version of Mingw32
if test x"${distro}" = x"lucid"; then
- $CONFIG_SHELL ${abe_dir}/abe.sh --disable update ${change} ${tars} --host=i586-mingw32msvc ${platform} --build all
+ $CONFIG_SHELL ${abe_dir}/abe.sh --list-artifacts canadian-build2.txt --disable update ${change} ${tars} --host=i586-mingw32msvc ${platform} --build all
else
- $CONFIG_SHELL ${abe_dir}/abe.sh --disable update ${change} ${tars} --host=i686-w64-mingw32 ${platform} --build all
+ $CONFIG_SHELL ${abe_dir}/abe.sh --list-artifacts canadian-build2.txt --disable update ${change} ${tars} --host=i686-w64-mingw32 ${platform} --build all
fi
fi
@@ -515,13 +501,15 @@ if test x"${logserver}" != x"" && test x"${sums}" != x -o x"${runtests}" != x"tr
cp ${sums} ${test_logs} ${logs_dir}/ || status=1
# Copy over the logs from make check, which we need to find testcase errors.
- checks="$(find ${user_workspace} -name check\*.log)"
- cp ${checks} ${logs_dir}/ || status=1
+ for check in $(read_var check-artifacts.txt 'log_check_[^=]*'); do
+ cp ${check} ${logs_dir}/ || status=1
+ done
fi
# Copy over the build logs
- logs="$(find ${user_workspace} -name make\*.log)"
- cp ${logs} ${logs_dir}/ || status=1
+ for makelog in $(read_var check-artifacts.txt 'log_make_[^=]*'); do
+ cp ${makelog} ${logs_dir}/ || status=1
+ done
# Copy stdout and stderr output from abe.
cp build.out build.err ${logs_dir}/ || status=1