ces-build-lib
ces-build-lib copied to clipboard
SonarQube/Git: Branch Name works only in multi-branch pipelines
env.BRANCH_NAME
is only present in multi-branch pipeline builds, regular pipelines don't have information about branches.
Affected methods:
-
Git.getBranchName()
-
SonarQube.initMavenForRegularAnalysis()
We could use git rev-parse --abbrev-ref HEAD
in Git
class, instead. SonarQube could use Git class. Keeps everything DRY.
When fixed, update README.