]> git.ipfire.org Git - thirdparty/git.git/blobdiff - ci/lib.sh
ci/lib.sh: add support for Azure Pipelines
[thirdparty/git.git] / ci / lib.sh
index 32a28fd209bb184b173b47d365380d935ef2fef8..55057768765bd1ffd81f27e3b5ae9a42111c9dcb 100755 (executable)
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -102,6 +102,31 @@ then
        export GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save"
        export GIT_TEST_OPTS="--verbose-log -x --immediate"
        export MAKEFLAGS="--jobs=2"
+elif test -n "$SYSTEM_COLLECTIONURI" || test -n "$SYSTEM_TASKDEFINITIONSURI"
+then
+       CI_TYPE=azure-pipelines
+       # We are running in Azure Pipelines
+       CI_BRANCH="$BUILD_SOURCEBRANCH"
+       CI_COMMIT="$BUILD_SOURCEVERSION"
+       CI_JOB_ID="$BUILD_BUILDID"
+       CI_JOB_NUMBER="$BUILD_BUILDNUMBER"
+       CI_OS_NAME="$(echo "$AGENT_OS" | tr A-Z a-z)"
+       test darwin != "$CI_OS_NAME" || CI_OS_NAME=osx
+       CI_REPO_SLUG="$(expr "$BUILD_REPOSITORY_URI" : '.*/\([^/]*/[^/]*\)$')"
+       CC="${CC:-gcc}"
+
+       # use a subdirectory of the cache dir (because the file share is shared
+       # among *all* phases)
+       cache_dir="$HOME/test-cache/$SYSTEM_PHASENAME"
+
+       url_for_job_id () {
+               echo "$SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$1"
+       }
+
+       BREW_INSTALL_PACKAGES=
+       export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save"
+       export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml"
+       export MAKEFLAGS="--jobs=10"
 else
        echo "Could not identify CI type" >&2
        exit 1