diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2020-04-02 12:12:28 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-04-06 20:03:39 +0000 |
commit | d88d0e1a3eba749944c3d52fb193a354ee1dbef2 (patch) | |
tree | ef3daa226fc4ada19b9a8d04202b3e3b168200b7 | |
parent | ce47b04beb2dc4431dcce8b425d2339edc2ba5cc (diff) | |
download | sonarqube-d88d0e1a3eba749944c3d52fb193a354ee1dbef2.tar.gz sonarqube-d88d0e1a3eba749944c3d52fb193a354ee1dbef2.zip |
Fix the upgrade of the Gradle Artifactory plugin to 4.15.1
The configuration of private subprojects must be fixed
in order to correct set the properties like "build.name"
on private artifacts.
-rw-r--r-- | build.gradle | 75 | ||||
-rw-r--r-- | server/sonar-docs/build.gradle | 18 |
2 files changed, 52 insertions, 41 deletions
diff --git a/build.gradle b/build.gradle index ba308abbd55..b126bcb099c 100644 --- a/build.gradle +++ b/build.gradle @@ -70,6 +70,43 @@ allprojects { task allDependencies { dependsOn 'dependencies' } + + artifactory { + clientConfig.setIncludeEnvVars(true) + clientConfig.setEnvVarsExcludePatterns('*password*,*PASSWORD*,*secret*,*MAVEN_CMD_LINE_ARGS*,sun.java.command,*token*,*TOKEN*,*LOGIN*,*login*,*key*,*KEY*') + contextUrl = System.getenv('ARTIFACTORY_URL') + publish { + repository { + repoKey = System.getenv('ARTIFACTORY_DEPLOY_REPO') + username = System.getenv('ARTIFACTORY_DEPLOY_USERNAME') ?: project.properties.artifactoryUsername + password = System.getenv('ARTIFACTORY_DEPLOY_PASSWORD') ?: project.properties.artifactoryPaswword + } + defaults { + properties = [ + 'build.name': 'sonar-enterprise', + 'build.number': System.getenv('BUILD_NUMBER'), + 'pr.branch.target': System.getenv('GITHUB_BASE_BRANCH'), + 'pr.number': System.getenv('PULL_REQUEST'), + 'vcs.branch': System.getenv('GITHUB_BRANCH'), + 'vcs.revision': System.getenv('GIT_SHA1'), + 'version': version + ] + publications('mavenJava') + publishPom = true + publishIvy = false + } + } + clientConfig.info.setBuildName('sonar-enterprise') + clientConfig.info.setBuildNumber(System.getenv('BUILD_NUMBER')) + // Define the artifacts to be deployed to https://binaries.sonarsource.com on releases + clientConfig.info.addEnvironmentProperty('ARTIFACTS_TO_PUBLISH', + "${project.group}:sonar-application:zip," + + "com.sonarsource.sonarqube:sonarqube-developer:zip," + + "com.sonarsource.sonarqube:sonarqube-datacenter:zip," + + "com.sonarsource.sonarqube:sonarqube-enterprise:zip") + // The name of this variable is important because it's used by the delivery process when extracting version from Artifactory build info. + clientConfig.info.addEnvironmentProperty('PROJECT_VERSION', "${version}") + } } apply plugin: 'org.sonarqube' @@ -491,44 +528,6 @@ yarnInstallTasks.drop(1).eachWithIndex { it, i -> it.mustRunAfter(yarnInstallTas // and to prevent developers from forgetting to update lock file when they update "package.json" yarnInstallTasks.each { it -> it.args = ['--frozen-lockfile'] } - -artifactory { - clientConfig.setIncludeEnvVars(true) - clientConfig.setEnvVarsExcludePatterns('*password*,*PASSWORD*,*secret*,*MAVEN_CMD_LINE_ARGS*,sun.java.command,*token*,*TOKEN*,*LOGIN*,*login*,*key*,*KEY*') - contextUrl = System.getenv('ARTIFACTORY_URL') - publish { - repository { - repoKey = System.getenv('ARTIFACTORY_DEPLOY_REPO') - username = System.getenv('ARTIFACTORY_DEPLOY_USERNAME') ?: project.properties.artifactoryUsername - password = System.getenv('ARTIFACTORY_DEPLOY_PASSWORD') ?: project.properties.artifactoryPaswword - } - defaults { - properties = [ - 'build.name': 'sonar-enterprise', - 'build.number': System.getenv('BUILD_NUMBER'), - 'pr.branch.target': System.getenv('GITHUB_BASE_BRANCH'), - 'pr.number': System.getenv('PULL_REQUEST'), - 'vcs.branch': System.getenv('GITHUB_BRANCH'), - 'vcs.revision': System.getenv('GIT_SHA1'), - 'version': version - ] - publications('mavenJava') - publishPom = true - publishIvy = false - } - } - clientConfig.info.setBuildName('sonar-enterprise') - clientConfig.info.setBuildNumber(System.getenv('BUILD_NUMBER')) - // Define the artifacts to be deployed to https://binaries.sonarsource.com on releases - clientConfig.info.addEnvironmentProperty('ARTIFACTS_TO_PUBLISH', - "${project.group}:sonar-application:zip," + - "com.sonarsource.sonarqube:sonarqube-developer:zip," + - "com.sonarsource.sonarqube:sonarqube-datacenter:zip," + - "com.sonarsource.sonarqube:sonarqube-enterprise:zip") - // The name of this variable is important because it's used by the delivery process when extracting version from Artifactory build info. - clientConfig.info.addEnvironmentProperty('PROJECT_VERSION', "${version}") -} - // https://github.com/ben-manes/gradle-versions-plugin apply plugin: 'com.github.ben-manes.versions' dependencyUpdates { diff --git a/server/sonar-docs/build.gradle b/server/sonar-docs/build.gradle index cea99b44015..776922445f5 100644 --- a/server/sonar-docs/build.gradle +++ b/server/sonar-docs/build.gradle @@ -112,11 +112,23 @@ publishing { artifactory { publish { - contextUrl = System.getenv('ARTIFACTORY_URL') repository { repoKey = System.getenv('ARTIFACTORY_DEPLOY_REPO_PRIVATE') - username = System.getenv('ARTIFACTORY_DEPLOY_USERNAME_PRIVATE') - password = System.getenv('ARTIFACTORY_DEPLOY_PASSWORD_PRIVATE') + username = System.getenv('ARTIFACTORY_DEPLOY_USERNAME_PRIVATE') ?: project.properties.artifactoryUsername + password = System.getenv('ARTIFACTORY_DEPLOY_PASSWORD_PRIVATE') ?: project.properties.artifactoryPaswword + } + defaults { + properties = [ + 'build.name' : 'sonar-enterprise', + 'build.number' : System.getenv('BUILD_NUMBER'), + 'pr.branch.target': System.getenv('GITHUB_BASE_BRANCH'), + 'pr.number' : System.getenv('PULL_REQUEST'), + 'vcs.branch' : System.getenv('GITHUB_BRANCH'), + 'vcs.revision' : System.getenv('GIT_SHA1'), + 'version' : version + ] + publishPom = true + publishIvy = false } } } |