I am pretty new to Gitlab and Sonarqube. Getting my code coverage of my pipeline in my sonarqube. Now I want to call the metrics of my code coverage in Gitlab. I have updated my gitlab.ci.yml file to get the api response and have added this URL "http://sonarqube.dev.aws.nervo.com/component_measures/domain/Coverage?id=com.nervo.microservices%3Adelivery/api/resource=delivery&metrics=ncloc,coverage"
When checked in postman for any response,it failed.
Goal: The goal is that on consecutive runs of the pipeline, code coverage has to be at least equal to the previous run. So if the last run had code coverage of 75%, the pipeline will not succeed until the coverage is at least 75%. If I now have code coverage at 76%, then that is the new bar. Any help on how to achieve this?
Thoughts: Call API response to check the code coverage for the previous build. And if it doesn't meets the bar, it will fail. I somehow have to update the YML file to check this. Don't know how to meet this.
Please help!! TIA
Sonarqube Version: 6.5