2025-10-02 12:12:29 +10:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2026-06-01 15:55:19 +02:00
|
|
|
# This script determines if the current branch should be deployed to dogfood.
|
2025-10-02 12:12:29 +10:00
|
|
|
#
|
|
|
|
|
# To avoid masking unrelated failures, this script will return 0 in either case,
|
|
|
|
|
# and will print `DEPLOY` or `NOOP` to stdout.
|
|
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
# shellcheck source=scripts/lib.sh
|
|
|
|
|
source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
|
|
|
|
|
cdroot
|
|
|
|
|
|
|
|
|
|
branch_name=$(git branch --show-current)
|
2026-02-27 16:32:10 +00:00
|
|
|
|
2026-06-01 15:55:19 +02:00
|
|
|
# We no longer deploy release branches to dogfood, and instead test them on the
|
|
|
|
|
# stable deployment.
|
2026-05-31 23:36:05 +10:00
|
|
|
# TODO: once we're happy with the new deployment process, we can remove this
|
2026-06-01 15:55:19 +02:00
|
|
|
# script and the related GitHub workflow.
|
2026-05-31 23:36:05 +10:00
|
|
|
if [[ "$branch_name" == "main" ]]; then
|
|
|
|
|
log "VERDICT: DEPLOY"
|
|
|
|
|
echo "DEPLOY" # stdout
|
|
|
|
|
else
|
|
|
|
|
log "VERDICT: NOOP"
|
|
|
|
|
echo "NOOP" # stdout
|
2025-10-02 12:12:29 +10:00
|
|
|
fi
|