precommit hook in git for sonar analysis and return quality gate response

328 views
Skip to first unread message

Rahul Nair

unread,
Apr 27, 2018, 5:29:23 AM4/27/18
to SonarQube
Hi there,

I have to create a pre-commit hook in Git and this should analyse my code in sonar and get quality gate response.
If Qulaity Gate response is Failed - then git should not allow commit the code.

I'm able to run sonar analysis using maven (mvn sonar:sonar), but this never get me the quality gate response.
Is there a way to get that.
I'm using shell script for pre-commit hook.

Thanks
Rahul Nair
Reply all
Reply to author
Forward
0 new messages