ci: renew dev session window during promotion
Foundation / checks (client) (push) Successful in 13s
Foundation / checks (deploy) (push) Successful in 14s
Foundation / checks (ecs) (push) Successful in 14s
Foundation / checks (checks) (push) Successful in 33s
Foundation / checks (network) (push) Successful in 18s
Foundation / checks (postgres) (push) Successful in 19s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 5m18s
Foundation / checks (client) (push) Successful in 13s
Foundation / checks (deploy) (push) Successful in 14s
Foundation / checks (ecs) (push) Successful in 14s
Foundation / checks (checks) (push) Successful in 33s
Foundation / checks (network) (push) Successful in 18s
Foundation / checks (postgres) (push) Successful in 19s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 5m18s
This commit is contained in:
@@ -62,10 +62,38 @@ jobs:
|
||||
text, count = re.subn(r'(?m)(name: REGION_BUILD, value: )[0-9a-f]{64}', rf'\g<1>{build}', text)
|
||||
if count != 2:
|
||||
raise SystemExit(f'{name}: expected two REGION_BUILD values, found {count}')
|
||||
text, count = re.subn(
|
||||
r'(name: REGION_RETAINED, value: ")([0-9a-f ]+)(")',
|
||||
lambda m: m.group(1) + ' '.join([build] + [v for v in m.group(2).split() if v != build]) + m.group(3),
|
||||
text,
|
||||
)
|
||||
if count != 1:
|
||||
raise SystemExit(f'{name}: expected one REGION_RETAINED value, found {count}')
|
||||
open(name, 'w', encoding='utf-8').write(text)
|
||||
print(f'Promoting dev to {digest}')
|
||||
PY
|
||||
|
||||
- name: Renew dev M10 session window
|
||||
run: |
|
||||
set -eu
|
||||
id="dev-$(date -u +%Y%m%dT%H%M%S)-$RANDOM"
|
||||
expiry="$(date -u -d '+240 minutes' +%s)"
|
||||
window="$id:$expiry"
|
||||
WINDOW="$window" python3 - <<'PY'
|
||||
import os, re
|
||||
path = 'deploy/kubernetes/region/dev-session-route/listener.yaml'
|
||||
text = open(path, encoding='utf-8').read()
|
||||
text, count = re.subn(
|
||||
r'(?m)(name: REGION_SESSION_WINDOW, value: ")[^"]*(")',
|
||||
lambda m: m.group(1) + os.environ['WINDOW'] + m.group(2),
|
||||
text,
|
||||
)
|
||||
if count != 1:
|
||||
raise SystemExit(f'{path}: expected one REGION_SESSION_WINDOW value, found {count}')
|
||||
open(path, 'w', encoding='utf-8').write(text)
|
||||
print('Renewed dev M10 session window')
|
||||
PY
|
||||
|
||||
- name: Validate and commit promotion
|
||||
run: |
|
||||
set -eu
|
||||
|
||||
Reference in New Issue
Block a user