13 lines
788 B
Bash
13 lines
788 B
Bash
#!/usr/bin/env bash
|
|
# CI-only authority: fixed Stage cleanup worker, no dynamic executable/container.
|
|
set -euo pipefail
|
|
set +x
|
|
[[ $# == 4 && $1 =~ ^[0-9a-f]{40}$ && $2 =~ ^[a-z0-9-]{8,64}$ && $3 =~ ^[0-9]+$ && $4 =~ ^(open|close)$ ]] || exit 2
|
|
[[ $3 -ge 60 && $3 -le 3600 && ${STAGE_TEST_APPROVAL:-} == owner-authorized-stage-editorial && ${CI:-} == true ]] || exit 2
|
|
[[ ! -e /.dockerenv && $(id -u) == 0 ]] || exit 2
|
|
# Provisioned through reviewed deployment, not through the credential CI command.
|
|
# Fail before any DB mutation unless reboot-persistent retry recovery is enabled.
|
|
systemctl is-enabled --quiet canina-stage-principal-cleanup.timer
|
|
systemctl is-active --quiet canina-stage-principal-cleanup.timer
|
|
exec /usr/bin/python3 /opt/services/canina/stage-principal-cleanup.py "$@"
|