Skip to content

Commit 33637a1

Browse files
SONARSCALA-37 Develocity setup. (#37)
1 parent 7700647 commit 33637a1

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

.cirrus.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ env:
99
ARTIFACTORY_DEPLOY_USERNAME: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer username]
1010
ARTIFACTORY_DEPLOY_PASSWORD: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer access_token]
1111
ARTIFACTORY_DEPLOY_REPO: sonarsource-public-qa
12+
DEVELOCITY_TOKEN: VAULT[development/kv/data/develocity data.token]
13+
DEVELOCITY_ACCESS_KEY: develocity.sonar.build=${DEVELOCITY_TOKEN}
1214
DEPLOY_PULL_REQUEST: "true"
1315
# Gradle settings
1416
GRADLE_USER_HOME: ${CIRRUS_WORKING_DIR}/.gradle
@@ -29,6 +31,9 @@ setup_gradle_cache_template: &SETUP_GRADLE_CACHE
2931
create_gradle_directory_script:
3032
- mkdir -p "${CIRRUS_WORKING_DIR}/.gradle"
3133

34+
log_develocity_url_script: &log_develocity_url_script |
35+
echo "Develocity URL: https://develocity.sonar.build/scans?search.publicHostnames=cirrus-ci-task-${CIRRUS_TASK_ID}"
36+
3237
only_if_sonarsource_qa_template: &ONLY_IF_SONARSOURCE_QA
3338
only_if: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_TAG == "" && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == "master" || $CIRRUS_BRANCH =~ "branch-.*" || $CIRRUS_BRANCH =~ "dogfood-on-.*")
3439

@@ -50,6 +55,7 @@ build_task:
5055
ORG_GRADLE_PROJECT_signingKeyId: VAULT[development/kv/data/sign data.key_id]
5156
<<: *SETUP_GRADLE_CACHE
5257
build_script:
58+
- *log_develocity_url_script
5359
- source cirrus-env BUILD
5460
- function gradle(){ ./gradlew "$@"; }; export -f gradle
5561
- gradle --version
@@ -73,6 +79,7 @@ mend_task:
7379
WS_APIKEY: VAULT[development/kv/data/mend data.apikey]
7480
<<: SETUP_GRADLE_CACHE
7581
scan_script:
82+
- *log_develocity_url_script
7683
- source cirrus-env QA
7784
- ./gradlew clean build --exclude-task test
7885
- source export_ws_variables_from_gradle
@@ -94,6 +101,7 @@ qa_plugin_task:
94101
- SQ_VERSION: "DEV"
95102
<<: *SETUP_GRADLE_CACHE
96103
plugin_script:
104+
- *log_develocity_url_script
97105
- source cirrus-env QA
98106
- ./gradlew ":its:plugin:test" --project-prop plugin
99107
"-Dsonar.runtimeVersion=${SQ_VERSION}"
@@ -110,6 +118,7 @@ qa_ruling_task:
110118
memory: 8G
111119
<<: *SETUP_GRADLE_CACHE
112120
ruling_script:
121+
- *log_develocity_url_script
113122
- source cirrus-env QA
114123
- git submodule update --init its/sources
115124
- ./gradlew ":its:ruling:test" --project-prop ruling
@@ -133,5 +142,6 @@ promote_task:
133142
ARTIFACTORY_PROMOTE_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promoter access_token]
134143
GITHUB_TOKEN: VAULT[development/github/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promotion token]
135144
promote_script:
145+
- *log_develocity_url_script
136146
- function gradle(){ ./gradlew "$@"; }; export -f gradle
137147
- cirrus_promote_gradle multi

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ version=1.19.0-SNAPSHOT
33
description=Code Analyzer for Scala
44
projectTitle=Scala
55
org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx1024m
6+
org.gradle.caching=true

settings.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@ pluginManagement {
55
}
66
}
77

8+
plugins {
9+
id 'com.gradle.develocity' version '3.18.2'
10+
}
11+
12+
develocity {
13+
server = 'https://develocity.sonar.build'
14+
}
15+
16+
def isCI = System.getenv('CI') != null
17+
18+
buildCache {
19+
local {
20+
enabled = !isCI
21+
}
22+
remote(develocity.buildCache) {
23+
enabled = true
24+
push = isCI
25+
}
26+
}
27+
828
dependencyResolutionManagement {
929
def slangDependenciesVersion = '1.17.0.6351'
1030
def analyzerCommonsVersion = '2.16.0.3141'

0 commit comments

Comments
 (0)