1# Account-wide teardown for GCP resources stamped with alchemy-* labels.
2# Requires GOOGLE_PROJECT_ID and either GOOGLE_ACCESS_TOKEN or
3# GOOGLE_APPLICATION_CREDENTIALS (a service-account JSON key).
4set -euo pipefail
5
6if [ -z "${GOOGLE_PROJECT_ID:-}" ] && [ -f "${HOME}/.config/gcloud/alchemy-project-id" ]; then
7 export GOOGLE_PROJECT_ID="$(cat "${HOME}/.config/gcloud/alchemy-project-id")"
8fi
9if [ -z "${GOOGLE_APPLICATION_CREDENTIALS:-}" ] && [ -f "${HOME}/.config/gcloud/alchemy-testing-sa.json" ]; then
10 export GOOGLE_APPLICATION_CREDENTIALS="${HOME}/.config/gcloud/alchemy-testing-sa.json"
11fi
12
13bun alchemy unsafe nuke --config ./stacks/nuke-gcp.ts \
14 --include 'GCP.*' \
15 --profile alchemy-testing \
16 --concurrency 16 \
17 --timeout 300 \
18 "$@"