summaryrefslogtreecommitdiff
path: root/jenkins.sh
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-25 13:31:23 +0000
commita9fa64aa28e4d35cbaff1ab72aa1be840865bd40 (patch)
treee6237f41da3996b5b184975cba74f23f99d1d1b0 /jenkins.sh
parentc2194b982d7f2b40de8212a546d58c9b903d3c9d (diff)
jenkins.sh: Use abe.sh --list-artifacts
Use --list-artifacts to locate tarballs, manifests Abe's logs, and *.sum/*.log files. This eliminates use of find from jenkins.sh. Change-Id: I824eac39e2dbcf7f3ef3cc893b446c4964e29ad4
Diffstat (limited to 'jenkins.sh')
-rwxr-xr-xjenkins.sh65
1 files changed, 31 insertions, 34 deletions
diff --git a/jenkins.sh b/jenkins.sh
index 8a12dbae..62e37055 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
@@ -318,8 +325,12 @@ if test -e "${PWD}/host.conf"; then
. "${PWD}/host.conf"
fi
-# Delete the previous test result files to avoid problems.
-find ${user_workspace} -name \*.sum -exec rm {} \; 2>&1 > /dev/null
+# We used to delete *.sum files, but this should not be necessary. This
+# check is transitional, and will be removed later.
+if [ ! -z "$(find ${user_workspace} -name \*.sum)" ]; then
+ echo "Found *.sum files, but workspace should be empty!"
+ exit 1
+fi
if test x"${try_bootstrap}" = xtrue; then
# Attempt to bootstrap GCC is build and target are compatible
@@ -346,7 +357,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 ${user_workspace}/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
@@ -374,21 +385,8 @@ if $runtests; then
check="--check all"
check="${check}${excludecheck_opt}${testcontainer_opt}"
- # 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 ${user_workspace}/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
@@ -414,14 +412,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.
@@ -435,7 +425,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 ${user_workspace}/build-artifacts.txt manifest)"
if test x"${manifest}" != x; then
echo "node=${node}" >> ${manifest}
echo "requestor=${requestor}" >> ${manifest}
@@ -477,18 +467,18 @@ if test x"${logserver}" != x""; then
fi
# Find all the test result files.
-sums="$(find ${user_workspace} -name \*.sum -not -path "*/gdb/testsuite/outputs/*")"
+sums="$(read_var ${user_workspace}/check-artifacts.txt 'dj_sum_[^=]*')"
# 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 ${user_workspace}/canadian-build1-artifacts.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 ${user_workspace}/canadian-build2-artifacts.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 ${user_workspace}/canadian-build2-artifacts.txt --disable update ${change} ${tars} --host=i686-w64-mingw32 ${platform} --build all
fi
fi
@@ -505,13 +495,20 @@ 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 ${user_workspace}/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
+ 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