Using new bitbucket pipeline integration

(Rusty Phillips) #1

I found this: https://blog.sonarsource.com/sonarcloud-bitbucket-pipe

Unfortunately, it looks a little incomplete.
When I run it against my java project, it seems to not figure out the project key.
I presume that it’s not actually using the sensible variable choices that come from bitbucket as variables.

I notice that the docker hub file for this new sonar scanner is completely devoid of info.
As is…basically all of sonar cloud’s site. How is this actually supposed to work? Previously, I’ve done this in a step, and just used it in a maven container. Using a pipeline would definitely be nicer, especially if it kept track of all these details for me rather than forcing me to figure them out.

mvn sonar:sonar -Dsonar.login=$SONAR_CLOUD_TOKEN -Dsonar.projectKey=$BITBUCKET_REPO_SLUG -Dsonar.branch.name=$BITBUCKET_BRANCH -Dsonar.projectName=$BITBUCKET_REPO_SLUG -Dsonar.projectVersion=1.0 -Dsonar.host.url=https://sonarcloud.io

(Fabrice Bellingard) #2

Have you read the documentation on https://sonarcloud.io/documentation/integrations/bitbucketcloud/?

There you will find a link to sample projects, where a Maven-based one is given and shows that you do not need to pass all those parameters.