Bladeren bron

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.
tags/8.3.0.34182
Simon Brandhof 4 jaren geleden
bovenliggende
commit
d88d0e1a3e
2 gewijzigde bestanden met toevoegingen van 52 en 41 verwijderingen
  1. 37
    38
      build.gradle
  2. 15
    3
      server/sonar-docs/build.gradle

+ 37
- 38
build.gradle Bestand weergeven

@@ -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 {

+ 15
- 3
server/sonar-docs/build.gradle Bestand weergeven

@@ -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
}
}
}

Laden…
Annuleren
Opslaan