aboutsummaryrefslogtreecommitdiffstats
path: root/.travis
diff options
context:
space:
mode:
authorJulien Carsique <julien.carsique@sonarsource.com>2022-03-29 12:38:48 +0200
committersonartech <sonartech@sonarsource.com>2022-03-30 13:38:10 +0000
commitc0e9acf073995edd96713a14ebc152ac3a8df685 (patch)
tree208a2a007f881b17328ed4ae2eb274acfb3e408e /.travis
parentd2c8f6d5606578ab9939732afd73d7c5f06bf247 (diff)
downloadsonarqube-c0e9acf073995edd96713a14ebc152ac3a8df685.tar.gz
sonarqube-c0e9acf073995edd96713a14ebc152ac3a8df685.zip
BUILD-1457 report failure to Burgr
Move passed build notification to Burgr at the end (after build, analysis and iris) Report build failure to Burgr
Diffstat (limited to '.travis')
-rwxr-xr-x.travis/setup_environment.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/.travis/setup_environment.sh b/.travis/setup_environment.sh
new file mode 100755
index 00000000000..2f11f417551
--- /dev/null
+++ b/.travis/setup_environment.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Sets up the environment to be able to send notifications to burgr
+# use generic environments to remove coupling with Travis ; see setup_promote_environment
+
+export GITHUB_REPO=${TRAVIS_REPO_SLUG}
+export BUILD_NUMBER=$TRAVIS_BUILD_NUMBER
+export PIPELINE_ID=${BUILD_NUMBER}
+if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
+ export GIT_SHA1=${TRAVIS_COMMIT} # $CIRRUS_CHANGE_IN_REPO
+ export GIT_BRANCH=$TRAVIS_BRANCH
+ export STAGE_TYPE="branch"
+ export STAGE_ID=${GIT_BRANCH}
+else
+ export GIT_SHA1=${TRAVIS_PULL_REQUEST_SHA}
+ export GIT_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
+ export PULL_REQUEST_BASE_BRANCH=$TRAVIS_BRANCH
+ export PULL_REQUEST_NUMBER=$TRAVIS_PULL_REQUEST
+ export STAGE_TYPE="pr_number"
+ export STAGE_ID=${PULL_REQUEST_NUMBER}
+fi
+echo "======= SHA1 is ${GIT_SHA1} on branch '${GIT_BRANCH}'. Burgr stage '${STAGE_TYPE} with stage ID '${STAGE_ID} ======="