Hello everyone
We established “a remote git server” and " a SonarQube community edition, Ver. 8.4" separately.
We also have Jenkins, Docker and Ansible.
We want before any pushing to a remote SCM, user committed new code be analyzed by SonarQube.
If the scan result and quality gates passed then new code pushed to the repository; Otherwise, give the appropriate message to the user and push action be canceled.
We almost realized can use the " pre-receive hook " or " update hook" in the remote git repository with following settings to connect to the relevant project in SonarQube:
-Dsonar.projectKey= ProjectKey
-Dsonar.projectName= ProjectName
-Dsonar.host.url= SonarQubeURL
-Dsonar.login= SonarQubeToken
-Dsonar.sources= SourcePath
-Dsonar.qualitygate.wait= true
Is using the above method a correct thing to do?
and the written settings are right and sufficient?!
Do you suggest a better solution?
Thank you very much for any help.
Best regards…