Open lenertovalucie opened 7 years ago
Hi,
Yes
-Dsonar.gitlab.commit_sha=$(git log --pretty=format:%H origin/master..$CI_BUILD_REF | tr '\n' ',')
Thanks, I tried your command but: 'tr' is not recognized as an internal or external command, operable program or batch file.
I can write some Powershell command for getting commits with git log, but I need to know how should property /d:sonar.gitlab.commit_sha looks like if there are more commits.
Alternative PowerShell command would be
(git log --pretty=format:%H origin/master..$env:CI_BUILD_REF) -join ","
for gitlab 9.x or above
(git log --pretty=format:%H origin/master..$env:CI_COMMIT_SHA) -join ","
Hi,
is there possibility run preview analysis for all commits in branch?
My command for SonarQube begin: MSBuild.SonarQube.Runner.exe begin /k:some_key /d:sonar.host.url=some_url /d:sonar.analysis.mode=preview /d:sonar.gitlab.only_issue_from_commit_line=true /d:sonar.gitlab.commit_sha=12345 /d:sonar.gitlab.ref_name=some_branch
The command is working but If I have two commits and push to the server, analysis run only for the last commit.
Is there possibility add more than one commit in property /d:sonar.gitlab.commit_sha?