Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 2 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ variables:
REGISTRY: 486234852809.dkr.ecr.us-east-1.amazonaws.com
BUILD_JOB_NAME: "build"
DEPENDENCY_CACHE_POLICY: pull
BUILD_CACHE_POLICY: pull
GRADLE_VERSION: "9.7.1" # must match gradle-wrapper.properties
S3_BUILD_CACHE_BUCKET: "dd-trace-java-gradle-build-cache"
S3_BUILD_CACHE_REGION: "us-east-1"
MASS_READ_URL: "https://mass-read.us1.ddbuild.io"
MAVEN_REPOSITORY_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/"
GRADLE_PLUGIN_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/"
Expand Down Expand Up @@ -235,14 +235,6 @@ default:
fallback_keys: # Use fallback keys because all cache types are not populated. See note under: populate_dep_cache
- 'dependency-base'
- 'dependency-lib'
- &build_cache
key: $CI_PIPELINE_ID-$CACHE_TYPE # Incremental build cache. Shared by all jobs in the pipeline of the same type
paths:
- .gradle/caches/$GRADLE_VERSION
- .gradle/$GRADLE_VERSION/executionHistory
- workspace
policy: $BUILD_CACHE_POLICY
unprotect: true
before_script:
- source .gitlab/gitlab-utils.sh
- *container_info
Expand Down Expand Up @@ -349,7 +341,6 @@ build:
optional: true
extends: .gradle_build
variables:
BUILD_CACHE_POLICY: push
CACHE_TYPE: "lib"
DEPENDENCY_CACHE_POLICY: pull
script:
Expand All @@ -375,7 +366,6 @@ build_tests:
extends: .gradle_build
variables:
<<: *tier_xl_variables
BUILD_CACHE_POLICY: push
DEPENDENCY_CACHE_POLICY: pull
parallel:
matrix:
Expand Down Expand Up @@ -433,13 +423,11 @@ populate_dep_cache:
- job: build_tests
artifacts: false
variables:
BUILD_CACHE_POLICY: pull
DEPENDENCY_CACHE_POLICY: push
cache:
- <<: *plugin_cache
policy: pull
- *dependency_cache
- *build_cache
rules:
- if: '$POPULATE_CACHE'
when: on_success
Expand Down
15 changes: 15 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@ pluginManagement {
}

plugins {
id("com.github.burrunan.s3-build-cache") version "1.9.9"
id("com.gradle.develocity") version "4.5.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}

val isCI = providers.environmentVariable("CI")
val isGitLabCI = providers.environmentVariable("GITLAB_CI")
val isGitLabTag = providers.environmentVariable("CI_COMMIT_TAG")
val gitLabRefSlug = providers.environmentVariable("CI_COMMIT_REF_SLUG")
val skipBuildscan = providers.environmentVariable("SKIP_BUILDSCAN").map { it.toBoolean() }.orElse(false)

develocity {
Expand All @@ -53,6 +57,17 @@ if (isCI.isPresent) {
local {
directory = File(rootDir, "workspace/build-cache")
}
if (isGitLabCI.isPresent && !isGitLabTag.isPresent) {
remote<com.github.burrunan.s3cache.AwsS3BuildCache> {
region = providers.environmentVariable("S3_BUILD_CACHE_REGION").get()
bucket = providers.environmentVariable("S3_BUILD_CACHE_BUCKET").get()
prefix =
"trial/v1/${gitLabRefSlug.get()}/${System.getProperty("os.arch")}/"
isPush = true
lookupDefaultAwsCredentials = true
isReducedRedundancy = false
}
}
}
}

Expand Down
Loading