Files
firefox-accounts-mirror/_scripts/trigger-docker-push-subplat.sh
Davey Alvarez 8d74902e0c feat(release): add SubPlat tag schema and release workflow
Because:

  - SubPlat-owned services (payments-next, payments-api) need to
    deploy on an independent cadence from FxA without dragging the
    rest of the monorepo's pods along on every release.
  - PAY-3701 introduces the fxa-repo half of that split: a parallel
    subplat-v1.TRAIN.PATCH tag convention and CI routing so SubPlat
    tags only run payments tests. The MozCloud/ArgoCD half (which
    pods actually roll for each tag) lands in PAY-3702.

This commit:

  - Adds .github/workflows/tag-release-subplat.yml, a manual
    workflow_dispatch that resolves the latest v1.TRAIN.0 tag,
    fails fast if subplat-v1.TRAIN.0 or subplat-train-TRAIN already
    exists on origin, and otherwise creates the SubPlat train
    branch and tag at the same commit.
  - Expands the docker.yml tag-validation regex to accept an
    optional `subplat-` prefix so the same image-build pipeline can
    build either tag scheme.
  - Adds _scripts/trigger-docker-push-subplat.sh and
    _scripts/trigger-dot-release-subplat.sh, mirroring their FxA
    siblings but strict on the subplat-v1.TRAIN.PATCH format and
    rooted on the subplat-train-TRAIN branch.
  - Wires both scripts up via new trigger:docker-push-subplat and
    trigger:dot-release-subplat yarn aliases in root package.json.
  - Tightens the FxA test-job tag filters in .circleci/config.yml
    from `/.*/` to `/^v\d+\.\d+\.\d+(-rc\d+)?$/` so v1.* tags only
    trigger FxA test jobs, and adds a playwright-payments-tests
    invocation filtered to `/^subplat-v\d+\.\d+\.\d+(-rc\d+)?$/`
    for SubPlat tags. Init / Build / Lint stay on `/.*/` and run
    for both schemes.

Closes #PAY-3701
2026-06-01 11:33:38 -07:00

45 lines
1.2 KiB
Bash
Executable File

#! /bin/bash
#
# Trigger the GitHub Actions docker.yml workflow to build and push the
# fxa-mono image at a given SubPlat git tag.
#
# Usage:
# ./_scripts/trigger-docker-push-subplat.sh <tag>
#
# Examples:
# ./_scripts/trigger-docker-push-subplat.sh subplat-v1.338.0
# ./_scripts/trigger-docker-push-subplat.sh subplat-v1.338.1
#
# Requires the `gh` CLI authenticated (run `gh auth status` to check).
set -euo pipefail
tag="${1:-}"
if [[ -z "${tag}" ]]; then
echo "Usage: ${0} <tag>" >&2
exit 1
fi
if [[ ! "${tag}" =~ ^subplat-v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-rc[0-9]+)?$ ]]; then
echo "ERROR: '${tag}' does not match the expected format (subplat-vMAJOR.MINOR.PATCH[-rcN])." >&2
exit 1
fi
if ! command -v gh >/dev/null 2>&1; then
echo "ERROR: the 'gh' CLI is not installed (https://cli.github.com)." >&2
exit 1
fi
repo="mozilla/fxa"
if ! gh api "repos/${repo}/git/refs/tags/${tag}" --silent >/dev/null 2>&1; then
echo "ERROR: tag '${tag}' does not exist on github.com/${repo}." >&2
exit 1
fi
gh workflow run docker.yml --repo "${repo}" -f "git_tag=${tag}"
echo "Triggered docker build for tag ${tag}"
echo "https://github.com/${repo}/actions/workflows/docker.yml"