Skip to content

Commit

Permalink
Merged in JSMT-201-setup-sonarqube-quality-gate (pull request #22)
Browse files Browse the repository at this point in the history
JSMT-201 fail build if quality gate failed

* JSMT-201 fail build if quality gate failed

* JSMT-201 code smell to test quality gate

* JSMT-201 install jq

* JSMT-201 remove code smell to test quality gate

* JSMT-201 update docker image to install jq

* JSMT-201 encode BITBUCKET_BRANCH variable


Approved-by: Volodymyr Batrukh
  • Loading branch information
zakharlistiev committed Jul 10, 2024
1 parent dda21c3 commit 74b2239
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ definitions:
password: $PIPELINES_JWT_TOKEN
script:
- atlas-mvn verify sonar:sonar -Dsonar.projectKey=msteams-jira-onprem-addon -Pcoverage
- |
ENCODED_BRANCH=$(echo "$BITBUCKET_BRANCH" | jq -sRr @uri)
STATUS=$(curl -s -u $SONAR_TOKEN: "https://sonar-enterprise.internal.atlassian.com/api/qualitygates/project_status?projectKey=msteams-jira-onprem-addon&branch=$ENCODED_BRANCH" | jq -r .projectStatus.status)
if [ "$STATUS" != "OK" ]; then
echo "Quality gate failed: https://sonar-enterprise.internal.atlassian.com/dashboard?branch=$ENCODED_BRANCH&id=msteams-jira-onprem-addon"
exit 1
fi
pipelines:
default:
- step:
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ RUN apt-get install -y powershell
# 8. Start PowerShell
RUN pwsh

# Install jq command for processing JSON files
RUN apt-get -y install jq

# Install xmlstarlet command to edit XML files
RUN apt-get -y install xmlstarlet

Expand Down

0 comments on commit 74b2239

Please sign in to comment.