From a9a7e742a62740113e16950f4e6bd328d457fcf2 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 9 Sep 2024 14:27:42 +1000 Subject: [PATCH] Adopt shared vars and omit unnecessary quotes in Buildkite pipeline See also https://github.com/woocommerce/woocommerce-ios/pull/13872 --- .buildkite/pipeline.yml | 33 ++++++++++++--------------------- .buildkite/shared-pipeline-vars | 8 ++++++++ 2 files changed, 20 insertions(+), 21 deletions(-) create mode 100755 .buildkite/shared-pipeline-vars diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index b7dad397d..d0520b339 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,30 +1,21 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json --- -# Nodes with values to reuse in the pipeline. -common_params: - # Common plugin settings to use with the `plugins` key. - - &common_plugins - - automattic/a8c-ci-toolkit#2.13.0 - agents: - queue: "android" + queue: android -# This is the default pipeline – it will build and test the app steps: - - label: "Gradle Wrapper Validation" - command: | - validate_gradle_wrapper - plugins: *common_plugins + - label: ":gradle: Gradle Wrapper Validation" + command: validate_gradle_wrapper + plugins: [$CI_TOOLKIT_PLUGIN] - # Wait for Gradle Wrapper to be validated before running any other jobs - wait - - label: "🛠 Build and Test" + - label: ":hammer_and_pick: Build and Test" command: ./gradlew --stacktrace testRelease - plugins: *common_plugins + plugins: [$CI_TOOLKIT_PLUGIN] - - label: "☢️ Danger - PR Check" + - label: ":radioactive_sign: Danger - PR Check" command: danger key: danger if: "build.pull_request.id != null" @@ -32,13 +23,13 @@ steps: manual: permit_on_passed: true agents: - queue: "linter" + queue: linter - - label: "🔬 Lint" + - label: ":microscope: Lint" command: ./gradlew --stacktrace lintRelease - plugins: *common_plugins + plugins: [$CI_TOOLKIT_PLUGIN] - - label: "🛠 Prototype Build" + - label: ":hammer_and_pick: Prototype Build" command: .buildkite/commands/build-prototype.sh - plugins: *common_plugins + plugins: [$CI_TOOLKIT_PLUGIN] if: "build.pull_request.id != null || build.pull_request.draft" diff --git a/.buildkite/shared-pipeline-vars b/.buildkite/shared-pipeline-vars new file mode 100755 index 000000000..bd55c5fe0 --- /dev/null +++ b/.buildkite/shared-pipeline-vars @@ -0,0 +1,8 @@ +#!/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_PLUGIN_VERSION="3.5.1" + +export CI_TOOLKIT_PLUGIN="automattic/a8c-ci-toolkit#$CI_TOOLKIT_PLUGIN_VERSION"