Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tooling] Use a shared Buildkite pipeline vars file #21026

Merged
merged 2 commits into from
Jul 2, 2024
Merged
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
8 changes: 1 addition & 7 deletions .buildkite/code-freeze.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# 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#3.4.2

agents:
queue: "android"

steps:
- label: "Code Freeze"
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-git-for-release-management.sh

Expand Down
8 changes: 1 addition & 7 deletions .buildkite/complete-code-freeze.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# 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#3.4.2

agents:
queue: "android"

steps:
- label: "Complete Code Freeze"
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-git-for-release-management.sh
.buildkite/commands/checkout-release-branch.sh
Expand Down
8 changes: 1 addition & 7 deletions .buildkite/finalize-release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# 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#3.4.2

agents:
queue: "android"

steps:
- label: "Finalize release"
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-git-for-release-management.sh
.buildkite/commands/checkout-release-branch.sh
Expand Down
8 changes: 1 addition & 7 deletions .buildkite/new-beta-release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# 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#3.4.2

agents:
queue: "android"

steps:
- label: "New Beta Release"
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-git-for-release-management.sh
Expand Down
37 changes: 16 additions & 21 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@

# Nodes with values to reuse in the pipeline.
common_params:
# Common plugin settings to use with the `plugins` key.
- &ci_toolkit
automattic/a8c-ci-toolkit#3.4.2
- &test_collector
test-collector#v1.8.0
- &test_collector_common_params
files: "buildkite-test-analytics/*.xml"
format: "junit"
Expand All @@ -22,7 +17,7 @@ steps:
- label: "Gradle Wrapper Validation"
command: |
validate_gradle_wrapper
plugins: [*ci_toolkit]
plugins: [$CI_TOOLKIT]

# Wait for Gradle Wrapper to be validated before running any other jobs
- wait
Expand All @@ -46,15 +41,15 @@ steps:
command: |
cp gradle.properties-example gradle.properties
./gradlew checkstyle
plugins: [*ci_toolkit]
plugins: [$CI_TOOLKIT]
artifact_paths:
- "**/build/reports/checkstyle/checkstyle.*"

- label: "🕵️ detekt"
command: |
cp gradle.properties-example gradle.properties
./gradlew detekt
plugins: [*ci_toolkit]
plugins: [$CI_TOOLKIT]
artifact_paths:
- "**/build/reports/detekt/detekt.html"

Expand All @@ -73,7 +68,7 @@ steps:
cp gradle.properties-example gradle.properties
.buildkite/commands/dependency-tree-diff.sh
if: build.pull_request.id != null
plugins: [*ci_toolkit]
plugins: [$CI_TOOLKIT]

#################
# Unit Tests
Expand All @@ -83,8 +78,8 @@ steps:
- label: "🔬 Unit Test WordPress"
command: ".buildkite/commands/run-unit-tests.sh wordpress"
plugins:
- *ci_toolkit
- *test_collector :
- $CI_TOOLKIT
- $TEST_COLLECTOR :
<<: *test_collector_common_params
api-token-env-name: "BUILDKITE_ANALYTICS_TOKEN_UNIT_TESTS_WORDPRESS"
artifact_paths:
Expand All @@ -93,8 +88,8 @@ steps:
- label: "🔬 Unit Test Processors"
command: ".buildkite/commands/run-unit-tests.sh processors"
plugins:
- *ci_toolkit
- *test_collector :
- $CI_TOOLKIT
- $TEST_COLLECTOR :
<<: *test_collector_common_params
api-token-env-name: "BUILDKITE_ANALYTICS_TOKEN_UNIT_TESTS_PROCESSORS"
artifact_paths:
Expand All @@ -103,8 +98,8 @@ steps:
- label: "🔬 Unit Test Image Editor"
command: ".buildkite/commands/run-unit-tests.sh image-editor"
plugins:
- *ci_toolkit
- *test_collector :
- $CI_TOOLKIT
- $TEST_COLLECTOR :
<<: *test_collector_common_params
api-token-env-name: "BUILDKITE_ANALYTICS_TOKEN_UNIT_TESTS_IMAGE_EDITOR"
artifact_paths:
Expand All @@ -118,8 +113,8 @@ steps:
- label: ":wordpress: 🔬 Instrumented tests"
command: ".buildkite/commands/run-instrumented-tests.sh wordpress"
plugins:
- *ci_toolkit
- *test_collector :
- $CI_TOOLKIT
- $TEST_COLLECTOR :
<<: *test_collector_common_params
api-token-env-name: "BUILDKITE_ANALYTICS_TOKEN_INSTRUMENTED_TESTS_WORDPRESS"
artifact_paths:
Expand All @@ -128,8 +123,8 @@ steps:
- label: ":jetpack: 🔬 Instrumented tests"
command: ".buildkite/commands/run-instrumented-tests.sh jetpack"
plugins:
- *ci_toolkit
- *test_collector :
- $CI_TOOLKIT
- $TEST_COLLECTOR :
<<: *test_collector_common_params
api-token-env-name: "BUILDKITE_ANALYTICS_TOKEN_INSTRUMENTED_TESTS_JETPACK"
artifact_paths:
Expand All @@ -143,9 +138,9 @@ steps:
- label: ":wordpress: :android: Prototype Build"
command: ".buildkite/commands/prototype-build.sh wordpress"
if: build.pull_request.id != null
plugins: [*ci_toolkit]
plugins: [$CI_TOOLKIT]

- label: ":jetpack: :android: Prototype Build"
command: ".buildkite/commands/prototype-build.sh jetpack"
if: build.pull_request.id != null
plugins: [*ci_toolkit]
plugins: [$CI_TOOLKIT]
14 changes: 4 additions & 10 deletions .buildkite/release-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
# This pipeline is meant to be run via the Buildkite API, and is
# only used for release builds

# 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#3.4.2

agents:
queue: "android"

Expand All @@ -21,7 +15,7 @@ steps:
command: |
validate_gradle_wrapper
priority: 1
plugins: *common_plugins
plugins: [$CI_TOOLKIT]

# Wait for Gradle Wrapper to be validated before running any other jobs
- wait
Expand Down Expand Up @@ -57,7 +51,7 @@ steps:
command: ".buildkite/commands/release-build.sh wordpress"
priority: 1
depends_on: wplint
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
notify:
- slack: "#build-and-ship"

Expand All @@ -66,7 +60,7 @@ steps:
command: ".buildkite/commands/release-build.sh jetpack"
priority: 1
depends_on: jplint
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
notify:
- slack: "#build-and-ship"

Expand All @@ -79,4 +73,4 @@ steps:
- jpbuild
command: ".buildkite/commands/create-github-release.sh"
priority: 1
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
8 changes: 1 addition & 7 deletions .buildkite/schedules/dependency-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# 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.
- &ci_toolkit
automattic/a8c-ci-toolkit#3.4.2

agents:
queue: "android"

Expand All @@ -16,7 +10,7 @@ steps:
echo "--- 📊 Analyzing"
cp gradle.properties-example gradle.properties
./gradlew buildHealth
plugins: [*ci_toolkit]
plugins: [$CI_TOOLKIT]
artifact_paths:
- "build/reports/dependency-analysis/build-health-report.*"
notify:
Expand Down
7 changes: 7 additions & 0 deletions .buildkite/shared-pipeline-vars
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/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"
export TEST_COLLECTOR="test-collector#v1.10.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's hope the jump fro 1.8.0 to 1.10.1 won't break anything! (It shouldn't if they respect semver…)

8 changes: 1 addition & 7 deletions .buildkite/update-release-notes.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# 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#3.4.2

agents:
queue: "android"

steps:
- label: "Update release notes"
plugins: *common_plugins
plugins: [$CI_TOOLKIT]
command: |
.buildkite/commands/configure-git-for-release-management.sh
.buildkite/commands/checkout-editorial-branch.sh
Expand Down
Loading