Build Breaker Plugin with SonarQube 5.2

后端 未结 4 1345
遥遥无期
遥遥无期 2020-12-28 21:22

It seems like the Build Breaker Plugin is no longer compatible with SonarQube 5.2. Is there any alternative to have a (VSO) build fail if a Sonar gate is not fulfilled or ar

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-28 21:34

    With SonarQube 5.3 a new Quality Gates Web Service was introduced which could be called and used to break the build.

    To break the CI build for a failed Quality Gate, use WS API calls in a loop to wait until processing is finished, and then check Quality Gate web service:

    • call the analysis's ceTaskUrl and examine the "status" value:
      • PENDING or IN_PROGRESS - check again later
      • FAILED or CANCELED - break the build?
      • SUCCESS - move forward
    • call Quality Gate web service for status

    I've also added an issue to enhance the VSTS Tasks with an option to automatically call this service.

    Update: A recent PR added this feature to the VSTS Task (not released yet)

提交回复
热议问题