[ARVADOS] updated: 4b10b7265345211d0db4818c2ec1c804227511f6
Git user
git at public.curoverse.com
Sun Mar 20 13:16:52 EDT 2016
Summary of changes:
build/run-build-test-packages-one-target.sh | 112 ++++++++++++++++++++++++++++
build/run-library.sh | 41 ++++++++++
build/run-tests.sh | 42 +----------
3 files changed, 155 insertions(+), 40 deletions(-)
create mode 100755 build/run-build-test-packages-one-target.sh
via 4b10b7265345211d0db4818c2ec1c804227511f6 (commit)
from 3fbb8f2d87742f5075c1829c64cf223725cb4fd2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 4b10b7265345211d0db4818c2ec1c804227511f6
Author: Ward Vandewege <ward at curoverse.com>
Date: Sun Mar 20 13:16:18 2016 -0400
Build script improvements:
* move some more functions into run-library.sh
* add a wrapper script for our single target package build/test/upload step
No issue #
diff --git a/build/run-build-test-packages-one-target.sh b/build/run-build-test-packages-one-target.sh
new file mode 100755
index 0000000..da2bb05
--- /dev/null
+++ b/build/run-build-test-packages-one-target.sh
@@ -0,0 +1,112 @@
+#!/bin/bash
+
+read -rd "\000" helpmessage <<EOF
+$(basename $0): Build, test and (optionally) upload packages for one target
+
+Syntax:
+ WORKSPACE=/path/to/arvados $(basename $0) [options]
+
+--target <target>
+ Distribution to build packages for (default: debian7)
+--upload
+ If the build and test steps are successful, upload the packages
+ to a remote apt repository (default: false)
+
+WORKSPACE=path Path to the Arvados source tree to build packages from
+
+EOF
+
+if ! [[ -n "$WORKSPACE" ]]; then
+ echo >&2 "$helpmessage"
+ echo >&2
+ echo >&2 "Error: WORKSPACE environment variable not set"
+ echo >&2
+ exit 1
+fi
+
+if ! [[ -d "$WORKSPACE" ]]; then
+ echo >&2 "$helpmessage"
+ echo >&2
+ echo >&2 "Error: $WORKSPACE is not a directory"
+ echo >&2
+ exit 1
+fi
+
+PARSEDOPTS=$(getopt --name "$0" --longoptions \
+ help,upload,target: \
+ -- "" "$@")
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+
+TARGET=debian7
+UPLOAD=0
+
+eval set -- "$PARSEDOPTS"
+while [ $# -gt 0 ]; do
+ case "$1" in
+ --help)
+ echo >&2 "$helpmessage"
+ echo >&2
+ exit 1
+ ;;
+ --target)
+ TARGET="$2"; shift
+ ;;
+ --upload)
+ UPLOAD=1
+ ;;
+ --)
+ if [ $# -gt 1 ]; then
+ echo >&2 "$0: unrecognized argument '$2'. Try: $0 --help"
+ exit 1
+ fi
+ ;;
+ esac
+ shift
+done
+
+exit_cleanly() {
+ trap - INT
+ report_outcomes
+ exit ${#failures}
+}
+
+. $WORKSPACE/build/run-library.sh
+
+title "Start build packages"
+timer_reset
+
+$WORKSPACE/build/run-build-packages-one-target.sh --target $TARGET
+
+checkexit $? "build packages"
+title "End of build packages (`timer`)"
+
+#/usr/bin/sudo chown jenkins:jenkins $WORKSPACE/packages -R
+
+title "Start test packages"
+timer_reset
+
+if [ ${#failures[@]} -eq 0 ]; then
+ $WORKSPACE/build/run-build-packages-one-target.sh --target $TARGET --test-packages
+else
+ echo "Skipping package upload, there were errors building the packages"
+fi
+
+checkexit $? "test packages"
+title "End of test packages (`timer`)"
+
+if [[ "$UPLOAD" != 0 ]]; then
+ title "Start upload packages"
+ timer_reset
+
+ if [ ${#failures[@]} -eq 0 ]; then
+ /usr/local/arvados-dev/jenkins/run_upload_packages.py -H jenkinsapt at apt.arvados.org -o Port=2222 --workspace $WORKSPACE $TARGET
+ else
+ echo "Skipping package upload, there were errors building and/or testing the packages"
+ fi
+ checkexit $? "upload packages"
+ title "End of upload packages (`timer`)"
+fi
+
+exit_cleanly
diff --git a/build/run-library.sh b/build/run-library.sh
index bc76dd6..8d97ada 100755
--- a/build/run-library.sh
+++ b/build/run-library.sh
@@ -342,3 +342,44 @@ install_package() {
$SUDO yum -q -y install $PACKAGES
fi
}
+
+title () {
+ txt="********** $1 **********"
+ printf "\n%*s%s\n\n" $((($COLUMNS-${#txt})/2)) "" "$txt"
+}
+
+checkexit() {
+ if [[ "$1" != "0" ]]; then
+ title "!!!!!! $2 FAILED !!!!!!"
+ failures+=("$2 (`timer`)")
+ else
+ successes+=("$2 (`timer`)")
+ fi
+}
+
+timer_reset() {
+ t0=$SECONDS
+}
+
+timer() {
+ echo -n "$(($SECONDS - $t0))s"
+}
+
+report_outcomes() {
+ for x in "${successes[@]}"
+ do
+ echo "Pass: $x"
+ done
+
+ if [[ ${#failures[@]} == 0 ]]
+ then
+ echo "All test suites passed."
+ else
+ echo "Failures (${#failures[@]}):"
+ for x in "${failures[@]}"
+ do
+ echo "Fail: $x"
+ done
+ fi
+}
+
diff --git a/build/run-tests.sh b/build/run-tests.sh
index f56e46a..cb56c69 100755
--- a/build/run-tests.sh
+++ b/build/run-tests.sh
@@ -2,6 +2,8 @@
. `dirname "$(readlink -f "$0")"`/libcloud-pin
+. `dirname "$(readlink -f "$0")"`/run-library.sh
+
read -rd "\000" helpmessage <<EOF
$(basename $0): Install and test Arvados components.
@@ -124,24 +126,6 @@ fatal() {
exit 1
}
-report_outcomes() {
- for x in "${successes[@]}"
- do
- echo "Pass: $x"
- done
-
- if [[ ${#failures[@]} == 0 ]]
- then
- echo "All test suites passed."
- else
- echo "Failures (${#failures[@]}):"
- for x in "${failures[@]}"
- do
- echo "Fail: $x"
- done
- fi
-}
-
exit_cleanly() {
trap - INT
create-plot-data-from-log.sh $BUILD_NUMBER "$WORKSPACE/apps/workbench/log/test.log" "$WORKSPACE/apps/workbench/log/"
@@ -470,23 +454,6 @@ then
gem install --user-install bundler || fatal 'Could not install bundler'
fi
-checkexit() {
- if [[ "$1" != "0" ]]; then
- title "!!!!!! $2 FAILED !!!!!!"
- failures+=("$2 (`timer`)")
- else
- successes+=("$2 (`timer`)")
- fi
-}
-
-timer_reset() {
- t0=$SECONDS
-}
-
-timer() {
- echo -n "$(($SECONDS - $t0))s"
-}
-
retry() {
while ! ${@} && [[ "$retry" == 1 ]]
do
@@ -599,11 +566,6 @@ do_install_once() {
fi
}
-title () {
- txt="********** $1 **********"
- printf "\n%*s%s\n\n" $((($COLUMNS-${#txt})/2)) "" "$txt"
-}
-
bundle_install_trylocal() {
(
set -e
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list