diff --git a/docker/ci/init.sh b/docker/ci/init.sh index 73734aa1..0a645b98 100755 --- a/docker/ci/init.sh +++ b/docker/ci/init.sh @@ -1,24 +1,59 @@ #!/bin/bash -set -e - -cat <> /etc/containers/registries.conf +if [[ "$CACHE_REGISTRY" != "" ]]; then + cat <> /etc/containers/registries.conf [[registry]] prefix = "$CACHE_REGISTRY" insecure = true location = "$CACHE_REGISTRY" EOF +fi +function check_success() { + if [[ "$1" == "0" ]]; then + echo "1"; + else + echo "0"; + fi; +} function checkout() { if [ ! -d "$1" ]; then - git clone "$2" "$1" - pushd "$1" - git checkout "$3" - popd + git clone "$2" "$1" || exit + pushd "$1" || exit + git checkout "$3" || exit + popd || exit fi } -checkout kolab $GIT_REMOTE $GIT_REF -pushd kolab +checkout kolab "$GIT_REMOTE" "$GIT_REF" +pushd kolab || exit + +ci/testctl build +BUILD_RESULT=$(check_success $?) +ci/testctl lint +LINT_RESULT=$(check_success $?) ci/testctl testrun +TESTRUN_RESULT=$(check_success $?) + +if [[ "$PROMETHEUS_PUSHGATEWAY" != "" ]]; then + EPOCH=$(date +"%s") + METRICS=$( + cat <