]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-23626 publish Community Build and SonarQube Server independently.
authorSteve Marion <steve.marion@sonarsource.com>
Thu, 14 Nov 2024 15:55:28 +0000 (16:55 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 15 Nov 2024 20:02:43 +0000 (20:02 +0000)
Co-authored-by: Alain Kermis <alain.kermis@sonarsource.com>
Co-authored-by: Matteo Mara <matteo.mara@sonarsource.com>
12 files changed:
build.gradle
plugins/sonar-education-plugin/build.gradle
plugins/sonar-xoo-plugin/build.gradle
server/sonar-db-core/build.gradle
sonar-application/build.gradle
sonar-core/build.gradle
sonar-markdown/build.gradle
sonar-plugin-api-impl/build.gradle
sonar-scanner-engine/build.gradle
sonar-scanner-protocol/build.gradle
sonar-testing-harness/build.gradle
sonar-ws/build.gradle

index ffad3b3e6c252018225c59768d618598b2e891c9..f0109c28be673c196fde300023e2333ad9845148 100644 (file)
@@ -63,6 +63,7 @@ allprojects {
 
   ext {
     release = project.hasProperty('release') && project.getProperty('release')
+    deployCommunity = project.hasProperty('deployCommunity') && (project.getProperty('deployCommunity') == 'true')
     official = project.hasProperty('official') && project.getProperty('official')
   }
 
@@ -139,7 +140,23 @@ allprojects {
   artifactory {
     clientConfig.setIncludeEnvVars(true)
     clientConfig.setEnvVarsExcludePatterns('*pass*,*psw*,*secret*,*MAVEN_CMD_LINE_ARGS*,sun.java.command,*token*,*login*,*key*,*signing*,*auth*,*pwd*')
+    clientConfig.publisher.setFilterExcludedArtifactsFromBuild(true)
     contextUrl = System.getenv('ARTIFACTORY_URL')
+
+    //if property deployCommunity is true set the value to sonar-enterprise-sqcb
+    //otherwise set it to sqs
+    if (deployCommunity) {
+      clientConfig.info.setBuildName('sonar-enterprise-sqcb')
+      clientConfig.info.addEnvironmentProperty('ARTIFACTS_TO_PUBLISH',
+        "${project.group}:sonar-application:zip,")
+    } else {
+      clientConfig.info.setBuildName('sonar-enterprise-sqs')
+      clientConfig.info.addEnvironmentProperty('ARTIFACTS_TO_PUBLISH',
+        "com.sonarsource.sonarqube:sonarqube-developer:zip," +
+          "com.sonarsource.sonarqube:sonarqube-datacenter:zip," +
+          "com.sonarsource.sonarqube:sonarqube-enterprise:zip")
+    }
+
     publish {
       repository {
         repoKey = System.getenv('ARTIFACTORY_DEPLOY_REPO')
@@ -148,27 +165,20 @@ allprojects {
       }
       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': ghBranch,
-            'vcs.revision': System.getenv('GIT_SHA1'),
-            'version': version
+          'build.name'      : 'sonar-enterprise-sqcb',
+          'build.number'    : System.getenv('BUILD_NUMBER'),
+          'pr.branch.target': System.getenv('GITHUB_BASE_BRANCH'),
+          'pr.number'       : System.getenv('PULL_REQUEST'),
+          'vcs.branch'      : ghBranch,
+          '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}")
   }
index 23675c0c6c501a3a7a3a17ed315cedce4f3c7877..98bab88f73f49a5360f2d029814338796b0ba161 100644 (file)
@@ -30,7 +30,7 @@ jar {
     }
 }
 
-artifactoryPublish.skip = false
+artifactoryPublish.skip = !deployCommunity
 
 publishing {
     publications {
index f12ceadcdf859e85bfd975d2c922de0d826ed059..3bdcfa27b1b3a8f30a75e2781679e4dc119d9588 100644 (file)
@@ -33,7 +33,7 @@ jar {
   }
 }
 
-artifactoryPublish.skip = false
+artifactoryPublish.skip = !deployCommunity
 
 publishing {
   publications {
index 1fd40cd6a704ff1e93eba0db19f80d629e89dd8f..9353704a08e7eea69dee489d7684ccd9547d62ae 100644 (file)
@@ -57,7 +57,7 @@ test {
     systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl')
 }
 
-artifactoryPublish.skip = false
+artifactoryPublish.skip = !deployCommunity
 
 // Used by core plugins
 publishing {
index c0e626f650c129179444e3ef8376777be7fa717d..50f06c839ad7776a8bb8bc8405aa58c3f6b2adc9 100644 (file)
@@ -373,7 +373,7 @@ assemble.dependsOn cleanLocalUnzippedDir
 
 artifacts { zip zip }
 
-artifactoryPublish.skip = false
+artifactoryPublish.skip = !deployCommunity
 
 def bomFile = layout.buildDirectory.file('reports/bom.json')
 cyclonedxBom {
index 6413e9101e5fd5cee4a21202d2557ea5671fc073..5c922dc1ae894d874a51a288c37c3ea0bab6a85e 100644 (file)
@@ -40,7 +40,7 @@ dependencies {
 }
 
 // Used by sonar-db-core to run DB Unit Tests
-artifactoryPublish.skip = false
+artifactoryPublish.skip = !deployCommunity
 publishing {
   publications {
     mavenJava(MavenPublication) {
index 4e7c2fc790c9218e32540ecf12c3e6bc3f7ab6b2..b2c00376d02fbbbdc834e88f16903ba0687ab5ca 100644 (file)
@@ -15,7 +15,7 @@ dependencies {
   testImplementation 'org.assertj:assertj-core'
 }
 
-artifactoryPublish.skip = false
+artifactoryPublish.skip = !deployCommunity
 
 publishing {
   publications {
index 2417c1f89faecaa4d3de12f40a1d3a6403edf7d9..978379e5f13a0555193e47515f04b0ed35a73b44 100644 (file)
@@ -39,7 +39,7 @@ processResources {
   ]
 }
 
-artifactoryPublish.skip = false
+artifactoryPublish.skip = !deployCommunity
 
 publishing {
   publications {
index de0f9f12d19e6e4f8505ceb782e982f30bd89fb5..f9252430adcc6238fe1cfaedc6eb8c319fb348b9 100644 (file)
@@ -83,7 +83,7 @@ license {
   excludes(["**/Fake.java", "**/Fake.groovy", "org/sonar/scanner/cpd/ManyStatements.java", "org/sonar/scm/git/expected-blame/**/*"])
 }
 
-artifactoryPublish.skip = false
+artifactoryPublish.skip = !deployCommunity
 
 // Used by core plugins
 publishing {
index 43ea08b6c59b9d3db9fcf6a69dcc8101b0eb4062..4402ce004ecdcc9ce047c47e2b40b129b90c1c7f 100644 (file)
@@ -44,7 +44,7 @@ task fatJar(type: Jar) {
 build.dependsOn fatJar
 
 // Used by sonar-db-core to run DB Unit Tests
-artifactoryPublish.skip = false
+artifactoryPublish.skip = !deployCommunity
 publishing {
   publications {
     mavenJava(MavenPublication) {
index 0ab5cc940d8f3b028a8f72b6625a42784208ccfb..a46a55fb568d9fc8175b8c44904259d95fd7b868 100644 (file)
@@ -19,7 +19,7 @@ dependencies {
   compileOnlyApi 'com.github.spotbugs:spotbugs-annotations'
 }
 
-artifactoryPublish.skip = false
+artifactoryPublish.skip = !deployCommunity
 publishing {
   publications {
     mavenJava(MavenPublication) {
index e33277140ef89d7a0c1989803f50df86b764f42e..5549917b93cd0c1e7e8cd21da586a97bd8060519 100644 (file)
@@ -39,7 +39,7 @@ dependencies {
   testFixturesApi 'commons-io:commons-io'
 }
 
-artifactoryPublish.skip = false
+artifactoryPublish.skip = !deployCommunity
 
 publishing {
   publications {