Large team with separate git branches per team and sonar as a code quality checker.
The scm tool is set up to pick up every branch that corresponds to this name: 'feature-branch-*'
which works perfectly, for the maven build.
I wanted to set up sonarqube so it would use a different branch for every actual git branch, but sonarqube does not allow wildcards.
It does however allow variables so I tried ${GIT_BRANCH}
, but this variable holds: 'origin/feature-branch-214'
, which sonarqube does not recognise as a valid branch name. Sonarqube expects 'feature-branch-214'
So I need something to put there (in sonarqube branch) that does a substring of the ${GIT_BRANCH}
to exclude the 'origin/'
part.
Or you could:
echo NEW_VAR=${GIT_BRANCH#*/} > newfile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With