File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 11sudo : required
2+ dist : trusty
23language : java
34jdk : oraclejdk8
45addons :
Original file line number Diff line number Diff line change 1-
2- PassFlag=` curl -s ' https://sonarcloud.io/api/project_badges/measure?project=java-tron&metric=alert_status' | grep -A4 " quality gate" | grep " pass" | wc -l`
3- echo " Please visit https://sonarcloud.io/dashboard?id=java-tron for more details"
4- if [ $PassFlag -eq 0 ]; then
1+ echo " current branch is : " $BUILDKITE_BRANCH
2+ SonarStatus_Url=" https://sonarcloud.io/api/qualitygates/project_status?projectKey=java-tron&branch=" $BUILDKITE_BRANCH
3+ Status=` curl -s $SonarStatus_Url | jq ' .projectStatus.status' `
4+ echo " current branch sonarcloud status is : " $Status
5+ if [ " $Status " = ' "ERROR"' ]; then
56 echo " Sonar Check Failed"
7+ echo " Please visit https://sonarcloud.io/dashboard?branch=" $BUILDKITE_BRANCH " &id=java-tron for more details"
68 exit 1
79else
810 echo " Sonar Check Pass"
911 exit 0
10- fi
12+ fi
You can’t perform that action at this time.
0 commit comments