Skip to content
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
15 changes: 15 additions & 0 deletions .buildkite/commands/gather-production-candidate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -eu

# Determines the current beta build, opens the "confirm the release" block step, and posts to
# Slack. No build — just gems + secrets.

echo "--- :rubygems: Setting up Gems"
install_gems

echo "--- :closed_lock_with_key: Installing Secrets"
bundle exec fastlane run configure_apply

echo "--- :android: Gathering the production candidate and opening the block step"
bundle exec fastlane gather_production_candidate
32 changes: 32 additions & 0 deletions .buildkite/commands/promote-to-production.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash

set -eu

# Releases the build gathered by the preceding step to the production track, once a developer has
# confirmed the block step. The version code is passed as the first argument; the Yes/No
# confirmation is read from Buildkite meta-data. No build — just gems + secrets.

VERSION_CODE="${1:-}"

# `production_ready_to_release` must stay in sync with PRODUCTION_CONFIRM_META_DATA_KEY in
# fastlane/lanes/promote.rb, which is the key the block-step confirmation field writes.
READY="$(buildkite-agent meta-data get "production_ready_to_release" --default "no")"

if [[ "${READY}" != "yes" ]]; then
echo "--- :no_entry_sign: Release not confirmed (production_ready_to_release=${READY}); skipping."
exit 0
fi

if [[ -z "${VERSION_CODE}" ]]; then
echo "+++ :x: No version code was provided to release."
exit 1
fi

echo "--- :rubygems: Setting up Gems"
install_gems

echo "--- :closed_lock_with_key: Installing Secrets"
bundle exec fastlane run configure_apply

echo "--- :rocket: Releasing ${VERSION_CODE} to the production track"
bundle exec fastlane promote_to_production version_code:"${VERSION_CODE}"
20 changes: 20 additions & 0 deletions .buildkite/promote-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
---

# Production release — run manually via the `PIPELINE` env var. Determines the current beta build,
# opens a block step to confirm the release, and releases it to the production track.

agents:
queue: "android"

steps:
- label: ":android: Gather build to release to production"
command: ".buildkite/commands/gather-production-candidate.sh"
plugins: [$CI_TOOLKIT]

# Slack backstop for any failed build — its unique value is failures that abort before the lane runs
# (gems/secrets) and can't self-report; on a lane failure it may also accompany the lane's own
# message. Channel intentionally stays the test channel for now (see send_slack_message).
notify:
- slack: "#test-wpmobile-slack-integration"
if: build.state == "failed"
Loading
Loading