Skip to content

Commit 5d1ae0c

Browse files
SCANGRADLE-193 Onboard Develocity
1 parent f669588 commit 5d1ae0c

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

.cirrus.yml

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ env:
1010
ARTIFACTORY_DEPLOY_PASSWORD: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer access_token]
1111
ARTIFACTORY_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token]
1212
ARTIFACTORY_DEPLOY_REPO: sonarsource-public-qa
13+
DEVELOCITY_TOKEN: VAULT[development/kv/data/develocity data.token]
14+
DEVELOCITY_ACCESS_KEY: develocity.sonar.build=${DEVELOCITY_TOKEN}
1315

1416
GITHUB_TOKEN: VAULT[development/github/token/licenses-ro token]
1517

@@ -51,6 +53,9 @@ setup_gradle_cache_template: &SETUP_GRADLE_CACHE
5153
only_sonarsource_qa: &ONLY_SONARSOURCE_QA
5254
only_if: $CIRRUS_USER_COLLABORATOR == 'true' && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == "master" || $CIRRUS_BRANCH =~ "branch-.*" || $CIRRUS_BRANCH =~ "dogfood-on-.*")
5355

56+
log_develocity_url_script: &log_develocity_url_script |
57+
echo "Develocity URL: https://develocity.sonar.build/scans?search.publicHostnames=cirrus-ci-task-${CIRRUS_TASK_ID}"
58+
5459
build_task:
5560
eks_container:
5661
<<: *CONTAINER_DEFINITION_17
@@ -67,6 +72,7 @@ build_task:
6772
maven_cache:
6873
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
6974
script:
75+
- *log_develocity_url_script
7076
- source cirrus-env BUILD
7177
- source cirrus/define-gradle.sh
7278
- mvn -f property-dump-plugin/pom.xml -B install
@@ -149,6 +155,7 @@ gradle_qa_task:
149155
- GRADLE_VERSION: 7.5.1
150156
ANDROID_GRADLE_VERSION: 7.1.0
151157
script:
158+
- *log_develocity_url_script
152159
- ./cirrus/cirrus-qa.sh
153160

154161
gradle_qa_java11_task:
@@ -168,6 +175,7 @@ gradle_qa_java11_task:
168175
- GRADLE_VERSION: 5.6.4
169176
ANDROID_GRADLE_VERSION: 3.5.4
170177
script:
178+
- *log_develocity_url_script
171179
- ./cirrus/cirrus-qa.sh
172180

173181
promote_task:

settings.gradle.kts

+19-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
rootProject.name = "sonarqube-gradle-plugin"
22

3-
var isCiServer = System.getenv().containsKey("CIRRUS_CI")
4-
var buildCacheHost = System.getenv().getOrDefault("CIRRUS_HTTP_CACHE_HOST", "localhost:12321")
5-
6-
buildCache {
7-
remote<HttpBuildCache> {
8-
isEnabled = isCiServer
9-
isPush = System.getenv()["GITHUB_BRANCH"] == "master"
10-
url = uri("http://${buildCacheHost}/")
3+
plugins {
4+
id("com.gradle.develocity") version("3.18.2")
5+
}
6+
develocity {
7+
server.set("https://develocity.sonar.build")
8+
buildScan {
9+
capture {
10+
buildLogging.set(!startParameter.taskNames.contains("properties"))
11+
}
1112
}
1213
}
14+
val isCI: Boolean = System.getenv("CI") != null
15+
buildCache {
16+
local {
17+
isEnabled = !isCI
18+
}
19+
remote(develocity.buildCache) {
20+
isEnabled = true
21+
isPush = isCI
22+
}
23+
}

0 commit comments

Comments
 (0)