Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCANGRADLE-193 Onboard Develocity #276

Merged
merged 3 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ env:
ARTIFACTORY_DEPLOY_PASSWORD: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer access_token]
ARTIFACTORY_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token]
ARTIFACTORY_DEPLOY_REPO: sonarsource-public-qa
DEVELOCITY_TOKEN: VAULT[development/kv/data/develocity data.token]
DEVELOCITY_ACCESS_KEY: develocity.sonar.build=${DEVELOCITY_TOKEN}

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

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

log_develocity_url_script: &log_develocity_url_script |
echo "Develocity URL: https://develocity.sonar.build/scans?search.publicHostnames=cirrus-ci-task-${CIRRUS_TASK_ID}"

build_task:
eks_container:
<<: *CONTAINER_DEFINITION_17
Expand All @@ -67,6 +72,7 @@ build_task:
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
script:
- *log_develocity_url_script
- source cirrus-env BUILD
- source cirrus/define-gradle.sh
- mvn -f property-dump-plugin/pom.xml -B install
Expand Down Expand Up @@ -149,6 +155,7 @@ gradle_qa_task:
- GRADLE_VERSION: 7.5.1
ANDROID_GRADLE_VERSION: 7.1.0
script:
- *log_develocity_url_script
- ./cirrus/cirrus-qa.sh

gradle_qa_java11_task:
Expand All @@ -168,6 +175,7 @@ gradle_qa_java11_task:
- GRADLE_VERSION: 5.6.4
ANDROID_GRADLE_VERSION: 3.5.4
script:
- *log_develocity_url_script
- ./cirrus/cirrus-qa.sh

promote_task:
Expand Down
27 changes: 19 additions & 8 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
rootProject.name = "sonarqube-gradle-plugin"

var isCiServer = System.getenv().containsKey("CIRRUS_CI")
var buildCacheHost = System.getenv().getOrDefault("CIRRUS_HTTP_CACHE_HOST", "localhost:12321")

buildCache {
remote<HttpBuildCache> {
isEnabled = isCiServer
isPush = System.getenv()["GITHUB_BRANCH"] == "master"
url = uri("http://${buildCacheHost}/")
plugins {
id("com.gradle.develocity") version("3.18.2")
}
develocity {
server.set("https://develocity.sonar.build")
buildScan {
capture {
buildLogging.set(!startParameter.taskNames.contains("properties"))
}
}
}
val isCI: Boolean = System.getenv("CI") != null
buildCache {
local {
isEnabled = !isCI
}
remote(develocity.buildCache) {
isEnabled = true
isPush = isCI
}
}
leonardo-pilastri-sonarsource marked this conversation as resolved.
Show resolved Hide resolved
Loading