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
3 changes: 2 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ default:
ln -s "$(pwd)/.mvn/caches/equo" "$HOME/.m2/repository/dev/equo"
fi
- export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xms$GRADLE_MEMORY_MIN -Xmx$GRADLE_MEMORY_MAX -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'"
- export GRADLE_ARGS=" --build-cache --stacktrace --no-daemon --parallel --max-workers=$GRADLE_WORKERS"
- export GRADLE_ARGS=" --info --build-cache --stacktrace --no-daemon --parallel --max-workers=$GRADLE_WORKERS"
- *normalize_node_index
# GitLab's cache helper restores .gradle as root, but we run as non-root-user (uid 1001),
# and Gradle does `chmod 700 .gradle` on startup which requires user ownership.
Expand Down Expand Up @@ -337,6 +337,7 @@ build:
script:
- if [ $CI_PIPELINE_SOURCE == "schedule" ] ; then ./gradlew resolveAndLockAll --write-locks $GRADLE_ARGS; fi
- ./gradlew --version
- if [ -n "$CI_COMMIT_TAG" ]; then GRADLE_ARGS="$GRADLE_ARGS -I .gitlab/release-build-cache.init.gradle"; echo "=== RELEASE BUILD - assembling agent jar with build cache reads disabled but results pushed to cache for downstream jobs ==="; fi
- ./gradlew clean :dd-java-agent:shadowJar :dd-java-agent:check :dd-trace-api:jar :dd-trace-ot:shadowJar -PskipTests -x spotlessCheck $GRADLE_ARGS
- echo UPSTREAM_TRACER_VERSION=$(java -jar workspace/dd-java-agent/build/libs/*.jar) >> upstream.env
- echo "BUILD_JOB_NAME=$CI_JOB_NAME" >> build.env
Expand Down
11 changes: 11 additions & 0 deletions .gitlab/release-build-cache.init.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Used during release builds to disable build cache reads while keeping writes enabled.
//
// This ensures the release agent jar is assembled via fresh task execution while still
// pushing results to the build cache where downstream jobs (e.g. `deploy_to_maven_central`)
// pull from. Pushing the freshly built jar to this cache is necessary to ensure the same
// release binary is published across all platforms.
gradle.settingsEvaluated { settings ->
settings.buildCache.remote?.with {
pull = false
}
}