aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build.gradle26
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/createdb/CreateDb.java1
2 files changed, 21 insertions, 6 deletions
diff --git a/build.gradle b/build.gradle
index 10c51e2f8ef..7ecd7e2ba1d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -68,18 +68,32 @@ allprojects {
// On local box, please add artifactoryUsername and artifactoryPassword to ~/.gradle/gradle.properties
def artifactoryUsername = System.env.'ARTIFACTORY_PRIVATE_USERNAME' ?: (project.hasProperty('artifactoryUsername') ? project.getProperty('artifactoryUsername') : '')
def artifactoryPassword = System.env.'ARTIFACTORY_PRIVATE_PASSWORD' ?: (project.hasProperty('artifactoryPassword') ? project.getProperty('artifactoryPassword') : '')
- if (artifactoryUsername && artifactoryPassword) {
- credentials {
- username artifactoryUsername
- password artifactoryPassword
- }
- } else {
+ if (!artifactoryUsername || ! artifactoryPassword) {
+
// Workaround for artifactory
// https://www.jfrog.com/jira/browse/RTFACT-13797
repository = 'public'
}
url "https://repox.jfrog.io/repox/${repository}"
}
+ ivy {
+ if (artifactoryUsername && artifactoryPassword) {
+ url "${artifactoryUrl}/sonarsource-bucket"
+
+ patternLayout {
+ artifact '/[organisation]/[module]/[module]-[revision].[ext]'
+ }
+ } else {
+ // For public build
+ url "https://artifacts.elastic.co/downloads/"
+
+ patternLayout {
+ artifact '/[organisation]/[module]-[revision].[ext]'
+ }
+ }
+
+ metadataSources { artifact() }
+ }
}
task allDependencies {
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/createdb/CreateDb.java b/server/sonar-db-dao/src/test/java/org/sonar/db/createdb/CreateDb.java
index 71b4990f005..dce3f1fdcb8 100644
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/createdb/CreateDb.java
+++ b/server/sonar-db-dao/src/test/java/org/sonar/db/createdb/CreateDb.java
@@ -44,6 +44,7 @@ public class CreateDb {
private static void createDb(Consumer<Configuration> execute) {
Configuration configuration = Configuration.builder()
.addSystemProperties()
+ .addEnvVariables()
.setProperty("orchestrator.keepDatabase", "false")
.build();