X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ffd741be7af1eca4c11884a3e8aa6630be25de2d..1aa0a5407d6a4e6b861d1fcf52d8268d62b9d6d4:/jenkins/run-build-packages-one-target.sh diff --git a/jenkins/run-build-packages-one-target.sh b/jenkins/run-build-packages-one-target.sh index afb6effa9e..95977030fc 100755 --- a/jenkins/run-build-packages-one-target.sh +++ b/jenkins/run-build-packages-one-target.sh @@ -14,11 +14,15 @@ Syntax: Run package install test script "test-packages-$target.sh" --debug Output debug information (default: false) +--only-test + Test only a specific package WORKSPACE=path Path to the Arvados source tree to build packages from EOF +set -e + if ! [[ -n "$WORKSPACE" ]]; then echo >&2 "$helpmessage" echo >&2 @@ -36,7 +40,7 @@ if ! [[ -d "$WORKSPACE" ]]; then fi PARSEDOPTS=$(getopt --name "$0" --longoptions \ - help,debug,test-packages,target:,command: \ + help,debug,test-packages,target:,command:,only-test: \ -- "" "$@") if [ $? -ne 0 ]; then exit 1 @@ -57,6 +61,9 @@ while [ $# -gt 0 ]; do --target) TARGET="$2"; shift ;; + --only-test) + packages="$2"; shift + ;; --debug) DEBUG=" --debug" ;; @@ -89,7 +96,7 @@ if [[ -n "$test_packages" ]]; then ) fi - COMMAND="/jenkins/test-packages-$TARGET.sh" + COMMAND="/jenkins/package-testing/test-packages-$TARGET.sh" IMAGE="arvados/package-test:$TARGET" else IMAGE="arvados/build:$TARGET" @@ -103,7 +110,8 @@ JENKINS_DIR=$(dirname "$(readlink -e "$0")") if [[ -n "$test_packages" ]]; then pushd "$JENKINS_DIR/package-test-dockerfiles" else - pushd "$JENKINS_DIR/dockerfiles" + pushd "$JENKINS_DIR/package-build-dockerfiles" + make "$TARGET/generated" fi echo $TARGET @@ -111,7 +119,8 @@ cd $TARGET time docker build --tag=$IMAGE . popd -packages="arvados-api-server +if test -z "$packages" ; then + packages="arvados-api-server arvados-data-manager arvados-docker-cleaner arvados-git-httpd @@ -123,29 +132,51 @@ packages="arvados-api-server keep-rsync keepstore keep-web - libarvados-perl - python27-python-arvados-fuse - python27-python-arvados-python-client" + libarvados-perl" + + case "$TARGET" in + centos6) + packages="$packages python27-python-arvados-fuse + python27-python-arvados-python-client" + ;; + *) + packages="$packages python-arvados-fuse + python-arvados-python-client" + ;; + esac +fi FINAL_EXITCODE=0 +package_fails="" + if [[ -n "$test_packages" ]]; then for p in $packages ; do - if ! docker run --rm -v "$JENKINS_DIR:/jenkins" -v "$WORKSPACE:/arvados" \ - --env ARVADOS_DEBUG=1 "$IMAGE" $COMMAND $p ; then + if docker run --rm -v "$JENKINS_DIR:/jenkins" -v "$WORKSPACE:/arvados" \ + --env ARVADOS_DEBUG=1 \ + --env "TARGET=$TARGET" \ + --env "WORKSPACE=/arvados" \ + "$IMAGE" $COMMAND $p ; then + true + else FINAL_EXITCODE=$? - echo "ERROR: $tag build failed with exit status $FINAL_EXITCODE." >&2 + package_fails="$package_fails $p" + echo "ERROR: $tag test failed with exit status $FINAL_EXITCODE." >&2 fi done else if docker run --rm -v "$JENKINS_DIR:/jenkins" -v "$WORKSPACE:/arvados" \ - --env ARVADOS_DEBUG=1 "$IMAGE" $COMMAND; then - # Success - nothing more to do. - true + --env ARVADOS_DEBUG=1 "$IMAGE" $COMMAND ; then + echo + echo "Build packages for $TARGET succeeded." >&2 else FINAL_EXITCODE=$? echo "ERROR: $tag build failed with exit status $FINAL_EXITCODE." >&2 fi fi +if test -n "$package_fails" ; then + echo "Failed package tests:$package_fails" >&2 +fi + exit $FINAL_EXITCODE