This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # collect-non-cacheable-goals.sh | |
| # | |
| # Lists the Maven goals and Gradle tasks that could be cached but were not for a given execution, | |
| # grouped by build tool, project, goal or task type and reason, with how many times each ran. | |
| # | |
| # - Maven: goals Develocity supports but marked non-cacheable (category | |
| # goal_execution_marked_non_cacheable, e.g. unhandled parameters or ambiguous properties). | |
| # Goals Develocity does not support at all (goal_not_supported) are left out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # collect-td-and-build-cache-stats.sh | |
| # | |
| # Measures two Develocity accelerations on Maven builds, per module, per project and in total: | |
| # - Test Distribution: test goal (surefire:test) durations with vs without TD | |
| # - Build cache: executions, cache hits and savings of a goal made cacheable (quarkus:build) | |
| # | |
| # For Test Distribution, granularity is one goal execution in one module (e.g. surefire:test@default-test in | |
| # my-service-app). Each execution is classified "with TD" or "without TD" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # collect-td-test-goals.sh | |
| # | |
| # Compares the duration of Maven test goal executions with and without Test Distribution, | |
| # per module, per project and in total. | |
| # | |
| # Granularity is one goal execution in one module (e.g. surefire:test@default-test in | |
| # orms-ms-agreement-manager-app). Each execution is classified "with TD" or "without TD" | |
| # from the build's Test Distribution status. Executions served from the build cache, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
NewerOlder