Browse Source

NO-JIRA configuring gradle enterprise to use remote cache

tags/10.3.0.82913
lukasz-jarocki-sonarsource 7 months ago
parent
commit
55ca904570
2 changed files with 37 additions and 2 deletions
  1. 4
    0
      .cirrus.yml
  2. 33
    2
      settings.gradle

+ 4
- 0
.cirrus.yml View File

BRANCH_NIGHTLY: "branch-nightly-build" BRANCH_NIGHTLY: "branch-nightly-build"
BRANCH_PATTERN_MAINTENANCE: "branch-.*" BRANCH_PATTERN_MAINTENANCE: "branch-.*"
BRANCH_PATTERN_PUBLIC: "public_.*" BRANCH_PATTERN_PUBLIC: "public_.*"
GRADLE_ENTERPRISE_USERNAME: VAULT[development/team/sonarqube/kv/data/gradle-enterprise data.username]
GRADLE_ENTERPRISE_PASSWORD: VAULT[development/team/sonarqube/kv/data/gradle-enterprise data.password]
GRADLE_ENTERPRISE_URL: VAULT[development/team/sonarqube/kv/data/gradle-enterprise data.url]
GRADLE_ENTERPRISE_KEY: VAULT[development/team/sonarqube/kv/data/gradle-enterprise data.access-key]


auto_cancellation: $CIRRUS_BRANCH != $BRANCH_MAIN && $CIRRUS_BRANCH !=~ $BRANCH_PATTERN_MAINTENANCE auto_cancellation: $CIRRUS_BRANCH != $BRANCH_MAIN && $CIRRUS_BRANCH !=~ $BRANCH_PATTERN_MAINTENANCE



+ 33
- 2
settings.gradle View File

} }
} }


plugins {
id 'com.gradle.enterprise' version '3.15.1'
}
ext.isCiServer = System.getenv().containsKey("CIRRUS_CI")

gradleEnterprise {
if (System.getenv().containsKey('GRADLE_ENTERPRISE_URL')) {
server = System.env.'GRADLE_ENTERPRISE_URL'
}
allowUntrustedServer = true // ensure a trusted certificate is configured

if (isCiServer) {
accessKey = System.env.'GRADLE_ENTERPRISE_KEY'
}

buildScan {
capture { taskInputFiles = true }
uploadInBackground = false
publishAlwaysIf( isCiServer )
}
}

rootProject.name = 'sonarqube' rootProject.name = 'sonarqube'


include 'plugins:sonar-xoo-plugin' include 'plugins:sonar-xoo-plugin'
include 'test-monitoring' include 'test-monitoring'
include 'ut-monitoring' include 'ut-monitoring'


ext.isCiServer = System.getenv().containsKey("CIRRUS_CI")


// use Settings.getRootDir() so that it doesn't matter which directory you are executing from // use Settings.getRootDir() so that it doesn't matter which directory you are executing from
File extraSettings = new File(rootDir, 'private/private-settings.gradle') File extraSettings = new File(rootDir, 'private/private-settings.gradle')
local { local {
enabled = !isCiServer enabled = !isCiServer
} }
}


remote(HttpBuildCache) {
url = System.env.'GRADLE_ENTERPRISE_URL' + '/cache/'
allowUntrustedServer = true
credentials { creds ->
creds.username = System.env.'GRADLE_ENTERPRISE_USERNAME'
creds.password = System.env.'GRADLE_ENTERPRISE_PASSWORD'
}
enabled = true
push = isCiServer
}
}

Loading…
Cancel
Save