From 74097ab380920382aeb16cf07a467d55bf87c9de Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Fri, 12 Jul 2024 13:46:31 +0300 Subject: [PATCH] CI: Use shared buildkite pipeline vars file For more info see: https://github.com/wordpress-mobile/ WordPress-Utils-Android/pull/150#issuecomment-2225298878 --- .buildkite/pipeline.yml | 13 ++++--------- .buildkite/schedules/dependency-analysis.yml | 7 +------ .buildkite/shared-pipeline-vars | 6 ++++++ 3 files changed, 11 insertions(+), 15 deletions(-) create mode 100644 .buildkite/shared-pipeline-vars diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 4012a1a18..d9f3d530c 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,11 +1,6 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json --- -common_params: - # Common plugin settings to use with the `plugins` key. - - &common_plugins - - automattic/a8c-ci-toolkit#3.4.2 - agents: queue: "android" @@ -13,14 +8,14 @@ steps: - label: "Gradle Wrapper Validation" command: | validate_gradle_wrapper - plugins: *common_plugins + plugins: [$CI_TOOLKIT] # Wait for Gradle Wrapper to be validated before running any other jobs - wait - label: "Lint & Checkstyle" key: "lint_and_checkstyle" - plugins: *common_plugins + plugins: [$CI_TOOLKIT] command: | cp gradle.properties-example gradle.properties ./gradlew lintRelease checkstyle @@ -30,7 +25,7 @@ steps: - label: "Test" key: "test" - plugins: *common_plugins + plugins: [$CI_TOOLKIT] command: | cp gradle.properties-example gradle.properties ./gradlew testRelease @@ -39,7 +34,7 @@ steps: depends_on: - "lint_and_checkstyle" - "test" - plugins: *common_plugins + plugins: [$CI_TOOLKIT] command: | cp gradle.properties-example gradle.properties ./gradlew \ diff --git a/.buildkite/schedules/dependency-analysis.yml b/.buildkite/schedules/dependency-analysis.yml index c9cc59641..6ecad5fb0 100644 --- a/.buildkite/schedules/dependency-analysis.yml +++ b/.buildkite/schedules/dependency-analysis.yml @@ -1,11 +1,6 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json --- -common_params: - # Common plugin settings to use with the `plugins` key. - - &common_plugins - - automattic/a8c-ci-toolkit#3.4.2 - agents: queue: "android" @@ -15,7 +10,7 @@ steps: echo "--- 📊 Analyzing" cp gradle.properties-example gradle.properties ./gradlew buildHealth - plugins: *common_plugins + plugins: [$CI_TOOLKIT] artifact_paths: - "build/reports/dependency-analysis/build-health-report.*" notify: diff --git a/.buildkite/shared-pipeline-vars b/.buildkite/shared-pipeline-vars new file mode 100644 index 000000000..6a7e2016c --- /dev/null +++ b/.buildkite/shared-pipeline-vars @@ -0,0 +1,6 @@ +#!/bin/sh + + # This file is `source`'d before calling `buildkite-agent pipeline upload`, and can be used + # to set up some variables that will be interpolated in the `.yml` pipeline before uploading it. + + export CI_TOOLKIT="automattic/a8c-ci-toolkit#3.4.2"