Skip to content

Instantly share code, notes, and snippets.

View jprinet's full-sized avatar

Jérôme Prinet jprinet

  • Bayonne, France
  • 09:54 (UTC +02:00)
View GitHub Profile
@jprinet
jprinet / collect-develocity-kpis.sh
Created August 18, 2026 16:15
Export per-build Develocity KPIs (build cache / Test Distribution / Predictive Test Selection savings) to CSV for weekly reporting
#!/usr/bin/env bash
#
# collect-develocity-kpis.sh
#
# Exports one row per build from a Develocity instance into a CSV, for weekly
# build-savings reporting.
#
# build_id, project_name, environment (CI|Local), build_tool, start_time,
# build_duration_ms, cache_savings_ms, test_distribution_savings_ms,
# predictive_test_selection_savings_ms
@jprinet
jprinet / gist:d3540e8cfd4a14401c4a533dcfbdb8b3
Created July 1, 2026 08:57
collect-build-metrics-2026.2.sh
#!/usr/bin/env bash
# collect-build-metrics.sh
#
# Collects weekly average CI build metrics from a Develocity instance.
#
# Metrics (CI builds only, averaged per build per Mon–Sun week):
# • Configuration time — Gradle/Maven configuration phase
# • Execution time — Gradle/Maven task/goal execution phase
# • Wall-clock download — network request time during the build
#
@jprinet
jprinet / gist:4b50f5ddc9a61a28b4797f25a46502c5
Created July 1, 2026 08:57
collect-build-metrics-2026.1.sh
#!/usr/bin/env bash
# collect-build-metrics.sh
#
# Collects weekly average CI build metrics from a Develocity instance.
#
# Metrics (CI builds only, averaged per build per Mon–Sun week):
# • Configuration time — Gradle/Maven configuration phase
# • Execution time — Gradle/Maven task/goal execution phase
# • Wall-clock download — network request time during the build
#
@jprinet
jprinet / gitlab-ci-gradle.yml
Last active June 3, 2026 09:10
Develocity Artifact Cache CLI - GitLab CI template for Gradle (downloads the CLI from the public docs.gradle.com download location). Adapted from the official GitHub Actions example.
# Artifact Cache CLI / Gradle + npm template for GitLab CI
#
# Adapted from the official GitHub Actions example at:
# https://docs.gradle.com/develocity/artifact-cache/1.2/how-to/configure-github-actions/#complete-workflow-example
#
# The Artifact Cache CLI is downloaded directly from the public Develocity
# download location, so no repository credentials are required:
# https://docs.gradle.com/develocity/artifact-cache/1.2/#download
#
# DEVELOCITY_ACCESS_KEY is expected to be injected as a masked env var at the
@jprinet
jprinet / .gitlab-ci.yml
Created May 27, 2026 16:32
Artifact Cache CLI / Maven template for GitLab CI
# Artifact Cache CLI / Maven template for GitLab CI
#
# Adapted from the official GitHub Actions example at:
# https://docs.gradle.com/develocity/artifact-cache/1.1/how-to/configure-github-actions/#complete-workflow-example
#
# Required CI/CD variables (Settings -> CI/CD -> Variables, masked + protected):
# - ARTIFACT_CACHE_REPO_USERNAME
# - ARTIFACT_CACHE_REPO_PASSWORD
#
# DEVELOCITY_ACCESS_KEY is expected to be injected as a masked env var at the
@jprinet
jprinet / gradle-enterprise-custom-user-data.groovy
Created November 3, 2025 09:53
Make openapi-generator-maven-plugin cacheable
log.debug('Evaluating custom Develocity logic')
buildCache.registerMojoMetadataProvider(context -> {
context.withPlugin("openapi-generator-maven-plugin", () -> {
if ("generate".equals(context.getMojoExecution().getGoal())) {
log.debug('Configuring OpenAPI code generator caching')
context.inputs(inputs -> {
try {
List<String> compileClasspathElements = context.getProject().getCompileClasspathElements();
@jprinet
jprinet / build.gradle.kts
Last active October 30, 2025 10:15
Capture execution time as custom value
import com.gradle.develocity.agent.gradle.scan.BuildScanConfiguration
import org.gradle.api.internal.project.ProjectInternal
import org.gradle.api.services.BuildService
import org.gradle.api.services.BuildServiceParameters
import org.gradle.tooling.events.FinishEvent
import org.gradle.tooling.events.OperationCompletionListener
import java.time.Instant
object Capture {
var startTime: Long = 0L
@jprinet
jprinet / gradle-enterprise-custom-user-data.groovy
Last active October 3, 2025 15:42
Make gwt-maven-plugin cacheable
log.debug('Evaluating custom Develocity logic')
buildCache.registerMojoMetadataProvider(context -> {
context.withPlugin("gwt-maven-plugin", () -> {
if ("compile".equals(context.getMojoExecution().getGoal())) {
log.debug('Configuring GWT caching')
context.inputs(inputs -> {
try {
List<String> compileClasspathElements = context.getProject().getCompileClasspathElements();
@jprinet
jprinet / build-count.sh
Created August 18, 2025 10:57
Count Develocity build scans
#!/bin/bash
# Parse CLI arguments
if [[ $# -lt 3 ]]; then
echo "Usage: $0 <develocity_url> <access_key> <from_instant_in_ms>"
exit 1
fi
# Init parameters
readonly develocityUrl=$1
@jprinet
jprinet / gist:d6047da5e074da968e810c2e4fb8ed7c
Last active July 4, 2025 10:16
collect-builds-by-custom-value.sh
#!/bin/bash
# Parse CLI arguments
if [[ $# -lt 3 ]]; then
echo "Usage: $0 <develocity_url> <access_key> <yyyy-mm>"
exit 1
fi
# Init parameters
readonly develocityUrl=$1