diff --git a/docker/ci/init.sh b/docker/ci/init.sh index 6468a979..5d95abbc 100755 --- a/docker/ci/init.sh +++ b/docker/ci/init.sh @@ -1,105 +1,128 @@ #!/bin/bash function check_success() { if [[ "$1" == "0" ]]; then echo "1"; else echo "0"; fi; } function checkout() { if [ ! -d "$1" ]; then git clone "$2" "$1" || exit pushd "$1" || exit git checkout "$3" || exit popd || exit fi } function pin_commit() { git ls-remote --exit-code -h "$1" "refs/heads/$2" | awk '{print $1}' } if [[ "$CACHE_REGISTRY" != "" ]]; then cat <> /etc/containers/registries.conf [[registry]] prefix = "$CACHE_REGISTRY" insecure = true location = "$CACHE_REGISTRY" EOF fi # This is the code that we are going to test checkout kolab "$GIT_REMOTE" "$GIT_REF" pushd kolab || exit # This are the pinned commits that are going to be used for the base images export KOLAB_GIT_REMOTE=https://git.kolab.org/source/kolab export KOLAB_GIT_REF=$(pin_commit "$KOLAB_GIT_REMOTE" "master") export GIT_REMOTE_ROUNDCUBEMAIL=https://git.kolab.org/source/roundcubemail.git export GIT_REF_ROUNDCUBEMAIL=$(pin_commit "$GIT_REMOTE_ROUNDCUBEMAIL" "dev/kolab-1.5") export GIT_REMOTE_ROUNDCUBEMAIL_PLUGINS=https://git.kolab.org/diffusion/RPK/roundcubemail-plugins-kolab.git export GIT_REF_ROUNDCUBEMAIL_PLUGINS=$(pin_commit "$GIT_REMOTE_ROUNDCUBEMAIL_PLUGINS" "master") export GIT_REMOTE_CHWALA=https://git.kolab.org/diffusion/C/chwala.git export GIT_REF_CHWALA=$(pin_commit "$GIT_REMOTE_CHWALA" "master") export GIT_REMOTE_SYNCROTON=https://git.kolab.org/diffusion/S/syncroton.git export GIT_REF_SYNCROTON=$(pin_commit "$GIT_REMOTE_SYNCROTON" "master") export GIT_REMOTE_AUTOCONF=https://git.kolab.org/diffusion/AC/autoconf.git export GIT_REF_AUTOCONF=$(pin_commit "$GIT_REMOTE_AUTOCONF" "master") export GIT_REMOTE_IRONY=https://git.kolab.org/source/iRony.git export GIT_REF_IRONY=$(pin_commit "$GIT_REMOTE_IRONY" "master") export GIT_REMOTE_FREEBUSY=https://git.kolab.org/diffusion/F/freebusy.git export GIT_REF_FREEBUSY=$(pin_commit "$GIT_REMOTE_FREEBUSY" "master") export IMAP_GIT_REMOTE=https://git.kolab.org/source/cyrus-imapd export IMAP_GIT_REF=$(pin_commit "$GIT_REMOTE_FREEBUSY" "dev/kolab-3.6") + +HOST=${HOST:-$HOSTNAME} +EPOCH=$(date +"%s") + # Execute if [[ $ROLE == "test" ]]; then ci/testctl build BUILD_RESULT=$(check_success $?) ci/testctl lint LINT_RESULT=$(check_success $?) ci/testctl testrun TESTRUN_RESULT=$(check_success $?) + + METRICS=$( + cat <