diff --git a/drydocker.sh b/drydocker.sh index 3fde13e..44610ff 100755 --- a/drydocker.sh +++ b/drydocker.sh @@ -1,272 +1,273 @@ #!/bin/bash -set -x - function usage { + set - -x echo "Usage: $0 [options]" echo "" echo "Options:" echo "" echo "--id " echo "" echo " The ID of the buildable." echo "" echo "--commit " echo "" echo " The commit ID to build and test." echo "" echo "--differential " echo "" echo " The differential ID to build and test." echo "" echo "--phid " echo "" echo " The Phabricator internal ID of the buildable." echo "" echo "--platforms " echo "" echo " The platforms to run tests on." echo "" echo "--uri " echo "" echo " The URI to the source code management repository," echo " also used to determine response credentials and" echo " feedback locations." echo "" echo " If not specified, assumes git.kolab.org is the" echo " appropriate Phabricator instance." echo "" echo "--vcs " echo "" echo " Version control system, defaults to 'git'" echo "" echo "Limiting tests run -- if neither is specified, all tests are" echo "run:" echo "" echo " --test-build" echo "" echo " Limit the tests run to just build tests." echo "" echo " --test-functional" echo "" echo " Limit the tests run to just functional tests." echo "" echo " --test-integration" echo "" echo " Limit the tests run to just integration tests." echo "" echo " --test-performance" echo "" echo " Limit the tests run to just performance tests." echo "" echo " --test-unit" echo "" echo " Limit the tests run to just unit tests." exit 1 } test_build=0 test_functional=0 test_integration=0 test_performance=0 test_unit=0 vcs="git" while [ $# -gt 0 ]; do case $1 in --id) id=$(eval echo $2) shift; shift ;; # buildable.commit --commit) commit=$(eval echo $2) shift; shift ;; # buildable.revision --differential) differential=$(eval echo $2) shift; shift ;; # target.phid --phid) phid=$(eval echo $2) shift; shift ;; --platforms) platforms=$(eval echo $2) shift; shift ;; --test-build) test_build=1 shift ;; --test-functional) test_functional=1 shift ;; --test-integration) test_integration=1 shift ;; --test-performance) test_performance=1 shift ;; --test-unit) test_unit=1 shift ;; --uri) uri=$(eval echo $2) shift; shift ;; --vcs) vcs=$(eval echo $2) shift; shift ;; *) usage ;; esac done +set -x + if [ -z "${commit}" -a -z "${differential}" ]; then echo "At least one of commit or differential is required." exit 1 fi if [ -z "${uri}" ]; then echo "No version control system URI specified." exit 1 fi if [ \ ${test_build} -eq 0 -a \ ${test_functional} -eq 0 -a \ ${test_integration} -eq 0 -a \ ${test_performance} -eq 0 -a \ ${test_unit} -eq 0 \ ]; then test_build=1 test_functional=1 test_integration=1 test_performance=1 test_unit=1 fi if [ -z "${vcs}" ]; then echo "No version control system specified." exit 1 fi case ${vcs} in git) package=$(basename ${uri} .git) ro_uri=$(echo ${uri} | sed -e 's|ssh://git@|https://|g') ;; *) echo "Unsupported version control system: ${vcs}" exit 1 ;; esac # Translate the package from git repo name to # an actual package name. case ${package} in freebusy) package="kolab-freebusy" ;; hkccp) package="kolab-hkccp" ;; syncroton) package="kolab-syncroton" ;; webadmin) package="kolab-webadmin" ;; esac case ${uri} in https://github.com/roundcube/roundcubemail) uri="https://git.kolab.org/diffusion/R/roundcubemail" ro_uri="https://git.kolab.org/diffusion/R/roundcubemail" ;; esac export TMPDIR="$(pwd)" if [ ! -d "${package}.git" ]; then git clone ${ro_uri} ${package}.git pushd ${package}.git git checkout ${commit} popd else pushd ${package}.git git remote set-url origin ${ro_uri} git fetch origin git reset --hard origin/master git clean -d -f -x git checkout ${commit} popd fi if [ "${package}" != "stick" ]; then if [ ! -d "stick.git" ]; then git clone https://git.kolab.org/diffusion/QA/stick.git stick.git else pushd stick.git git remote set-url origin https://git.kolab.org/diffusion/QA/stick.git git fetch origin git reset --hard origin/master git clean -d -f -x popd fi fi export commit export differential export id export package export phid export ro_uri export uri export vcs export test_build export test_functional export test_integration export test_performance export test_unit if [ -x "stick.git/drydocker/${package}/build.sh" ]; then pushd ${package}.git ../stick.git/drydocker/${package}/build.sh; retval=$? popd else echo "I have no build script for package '${package}'" fi cd /var/tmp rm -rf ${TMPDIR} exit ${retval} diff --git a/drydocker/autoconf/build.sh b/drydocker/autoconf/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/autoconf/build.sh +++ b/drydocker/autoconf/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $? diff --git a/drydocker/bonnie-flask/build.sh b/drydocker/bonnie-flask/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/bonnie-flask/build.sh +++ b/drydocker/bonnie-flask/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $? diff --git a/drydocker/copenhagen/build.sh b/drydocker/copenhagen/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/copenhagen/build.sh +++ b/drydocker/copenhagen/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $? diff --git a/drydocker/generic_integration.sh b/drydocker/generic_integration.sh new file mode 100644 index 0000000..3c6a4be --- /dev/null +++ b/drydocker/generic_integration.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +function generic_integration { + retval=0 + + max_tries=10 + try_retval=1 + + while [ ${try_retval} -ne 0 -a ${max_tries} -gt 0 ]; do + try_retval=$(_shell yum -y install kolab) + + if [ ${try_retval} -eq 0 ]; then + max_tries=0 + retval=0 + else + let max_tries-- + retval=${try_retval} + fi + + sleep 10 + + done + + if [ ${retval} -ne 0 ]; then + return ${retval} + fi + + retval=$(setup-kolab \ + --default \ + --mysqlserver=new \ + --timezone=Europe/Zurich \ + --directory-manager-pwd=Welcome2KolabSystems + ) + + return ${retval} +} diff --git a/drydocker/iRony/build.sh b/drydocker/iRony/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/iRony/build.sh +++ b/drydocker/iRony/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $? diff --git a/drydocker/kolab-freebusy/build.sh b/drydocker/kolab-freebusy/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/kolab-freebusy/build.sh +++ b/drydocker/kolab-freebusy/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $? diff --git a/drydocker/kolab-hkccp/build.sh b/drydocker/kolab-hkccp/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/kolab-hkccp/build.sh +++ b/drydocker/kolab-hkccp/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $? diff --git a/drydocker/kolab-syncroton/build.sh b/drydocker/kolab-syncroton/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/kolab-syncroton/build.sh +++ b/drydocker/kolab-syncroton/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $? diff --git a/drydocker/kolab-webadmin/build.sh b/drydocker/kolab-webadmin/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/kolab-webadmin/build.sh +++ b/drydocker/kolab-webadmin/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $? diff --git a/drydocker/libkolab/build.sh b/drydocker/libkolab/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/libkolab/build.sh +++ b/drydocker/libkolab/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $? diff --git a/drydocker/libkolabxml/build.sh b/drydocker/libkolabxml/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/libkolabxml/build.sh +++ b/drydocker/libkolabxml/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $? diff --git a/drydocker/php-net_ldap/build.sh b/drydocker/php-net_ldap/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/php-net_ldap/build.sh +++ b/drydocker/php-net_ldap/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $? diff --git a/drydocker/pykolab/build.sh b/drydocker/pykolab/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/pykolab/build.sh +++ b/drydocker/pykolab/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $? diff --git a/drydocker/pykolab/test_unit.sh b/drydocker/pykolab/test_unit.sh index 58e9ecf..cc4c419 100755 --- a/drydocker/pykolab/test_unit.sh +++ b/drydocker/pykolab/test_unit.sh @@ -1,5 +1,5 @@ #!/bin/bash pushd /srv/pykolab.git -nosetests tests/unit/ || exit 1 +NOSE_VERBOSE=2 nosetests tests/unit/ || exit 1 popd diff --git a/drydocker/roundcubemail-plugins-kolab/build.sh b/drydocker/roundcubemail-plugins-kolab/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/roundcubemail-plugins-kolab/build.sh +++ b/drydocker/roundcubemail-plugins-kolab/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $? diff --git a/drydocker/roundcubemail/build.sh b/drydocker/roundcubemail/build.sh index 1259a7d..2dc7502 100755 --- a/drydocker/roundcubemail/build.sh +++ b/drydocker/roundcubemail/build.sh @@ -1,28 +1,29 @@ #!/bin/bash set -x docker run -it \ --attach=stdout \ --attach=stderr \ --detach=false \ --rm=true \ --volume=/root/.oscrc:/root/.oscrc \ + --hostname="kolab.example.org" \ -e "ID=${id}" \ -e "COMMIT=${commit}" \ -e "DIFFERENTIAL=${differential}" \ -e "PACKAGE=${package}" \ -e "PHAB_CERT=${PHAB_CERT}" \ -e "PHAB_USER=${PHAB_USER}" \ -e "PHID=${phid}" \ -e "URI=${uri}" \ -e "RO_URI=${ro_uri}" \ -e "VCS=${vcs}" \ -e "TEST_BUILD=${test_build}" \ -e "TEST_FUNCTIONAL=${test_functional}" \ -e "TEST_INTEGRATION=${test_integration}" \ -e "TEST_PERFORMANCE=${test_performance}" \ -e "TEST_UNIT=${test_unit}" \ kolab/ci-maipo exit $?