This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add git repository info as sonarqube property defaults (#8)
Changed default values of sonarqube properties sonar.projectKey and sonar.projectName to be derived from git. If no git repository exists, the property defaults to null, using the default values provided by sonarqube gradle extension itself. Sonarqube property sonar.branch.name was added to provide support to multibranch analysis. It uses the git branch provided by atlas-github, and if it detects the branch name as a PR branch (with name starting with "PR-"), then it tries to find this branch "real" name using atlas-github exposed github api. Finally if it does not finds anything, it unsets the property. Co-authored-by: Joaquim Neto <[email protected]>
- Loading branch information
1 parent
d893ff8
commit 7417bab
Showing
5 changed files
with
154 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
#!groovy | ||
@Library('github.com/wooga/[email protected]') _ | ||
|
||
withCredentials([string(credentialsId: 'atlas_plugins_sonar_token', variable: 'sonar_token')]) { | ||
buildGradlePlugin platforms: ['macos','windows', 'linux'], sonarToken: sonar_token | ||
withCredentials([usernamePassword(credentialsId: 'github_integration', passwordVariable: 'githubPassword', usernameVariable: 'githubUser'), | ||
usernamePassword(credentialsId: 'github_integration_2', passwordVariable: 'githubPassword2', usernameVariable: 'githubUser2'), | ||
usernamePassword(credentialsId: 'github_integration_3', passwordVariable: 'githubPassword3', usernameVariable: 'githubUser3'), | ||
string(credentialsId: 'atlas_plugins_sonar_token', variable: 'sonar_token')]) { | ||
def testEnvironment = [ | ||
'macos': | ||
[ | ||
"ATLAS_GITHUB_INTEGRATION_USER=${githubUser}", | ||
"ATLAS_GITHUB_INTEGRATION_PASSWORD=${githubPassword}" | ||
], | ||
'windows': | ||
[ | ||
"ATLAS_GITHUB_INTEGRATION_USER=${githubUser2}", | ||
"ATLAS_GITHUB_INTEGRATION_PASSWORD=${githubPassword2}" | ||
], | ||
'linux': | ||
[ | ||
"ATLAS_GITHUB_INTEGRATION_USER=${githubUser3}", | ||
"ATLAS_GITHUB_INTEGRATION_PASSWORD=${githubPassword3}" | ||
] | ||
] | ||
|
||
buildGradlePlugin platforms: ['macos','windows', 'linux'], sonarToken: sonar_token, testEnvironment: testEnvironment | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters