Skip to content

Commit

Permalink
[Tooling] Use bot for release management git operations (#1666)
Browse files Browse the repository at this point in the history
  • Loading branch information
iangmaia authored Oct 25, 2024
2 parents d3e2599 + 62607e9 commit 43c8087
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 17 deletions.
19 changes: 19 additions & 0 deletions .buildkite/commands/configure-for-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
echo "This script must be 'source'd (instead of being called directly as an executable) to work properly"
exit 1
fi

# Note: Set the flags separately (instead of via the shebang), because that script will be `source`'d and not run directly
set -e
set -u

# The Git command line client is not configured in Buildkite.
# At the moment, steps that need Git access can configure it on demand using this script.
# Later on, we should be able to configure it on the agent instead.
git config --global user.email "[email protected]"
git config --global user.name "Automattic Release Bot"

echo '--- :robot_face: Use bot for git operations'
source use-bot-for-git
8 changes: 0 additions & 8 deletions .buildkite/commands/configure-git-for-release-management.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .buildkite/release-pipelines/complete-code-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ steps:
plugins: [$CI_TOOLKIT_PLUGIN]
command: |
echo '--- :git: Configure Git for Release Management'
.buildkite/commands/configure-git-for-release-management.sh
source .buildkite/commands/configure-for-release.sh
echo '--- :git: Checkout release branch'
.buildkite/commands/checkout-release-branch.sh
Expand Down
8 changes: 5 additions & 3 deletions .buildkite/release-pipelines/new-beta-release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
---

agents:
queue: mac
# Variables used in this pipeline are defined in `shared-pipeline-vars`, which is `source`'d before calling `buildkite-agent pipeline upload`

# The new beta workflow needs to run on macOS because it uses SwiftGen under the hood.
#
Expand All @@ -11,12 +10,15 @@ agents:
env:
IMAGE_ID: $IMAGE_ID

agents:
queue: mac

steps:
- label: New Beta Release
plugins: [$CI_TOOLKIT_PLUGIN]
command: |
echo '--- :git: Configure Git for Release Management'
.buildkite/commands/configure-git-for-release-management.sh
source .buildkite/commands/configure-for-release.sh
echo '--- :git: Checkout Release Branch'
.buildkite/commands/checkout-release-branch.sh
Expand Down
12 changes: 8 additions & 4 deletions .buildkite/release-pipelines/start-code-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@

# Variables used in this pipeline are defined in `shared-pipeline-vars`, which is `source`'d before calling `buildkite-agent pipeline upload`

env:
IMAGE_ID: $IMAGE_ID

agents:
queue: mac

steps:
- label: Start Code Freeze
plugins:
- $CI_TOOLKIT_PLUGIN
agents:
queue: tumblr-metal
command: |
echo '--- :robot_face: Use bot for Git operations'
source use-bot-for-git wpmobilebot
echo '--- :git: Configure Git for Release Management'
source .buildkite/commands/configure-for-release.sh
echo '--- :ruby: Setup Ruby Tools'
install_gems
Expand Down
2 changes: 1 addition & 1 deletion .xcode-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15.4
16.1-rc.1

0 comments on commit 43c8087

Please sign in to comment.