Skip to content

Commit fd3c7af

Browse files
Merge pull request #2372 from tronprotocol/fix_CI_master
modify querySonar&.travis
2 parents e9f8db0 + 5c27f75 commit fd3c7af

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sudo: required
2+
dist: trusty
23
language: java
34
jdk: oraclejdk8
45
addons:

querySonar.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
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
79
else
810
echo "Sonar Check Pass"
911
exit 0
10-
fi
12+
fi

0 commit comments

Comments
 (0)