ci: fix Nomad API path and use alloc stop for proper prestart re-run
Some checks are pending
/ deploy (push) Waiting to run
Some checks are pending
/ deploy (push) Waiting to run
This commit is contained in:
parent
e1bc2eed6e
commit
5dc0ad9695
1 changed files with 5 additions and 5 deletions
|
|
@ -16,10 +16,10 @@ jobs:
|
||||||
set -e
|
set -e
|
||||||
ALLOC_ID=$(curl -sf \
|
ALLOC_ID=$(curl -sf \
|
||||||
-H "X-Nomad-Token: $NOMAD_TOKEN" \
|
-H "X-Nomad-Token: $NOMAD_TOKEN" \
|
||||||
"$NOMAD_ADDR/v1/jobs/thefatdragon/allocations" \
|
"$NOMAD_ADDR/v1/job/thefatdragon/allocations" \
|
||||||
| grep -o '"ID":"[^"]*"' | head -1 | cut -d'"' -f4)
|
| python3 -c "import sys,json; allocs=json.load(sys.stdin); print(next(a['ID'] for a in allocs if a['ClientStatus']=='running'))")
|
||||||
echo "Restarting allocation: $ALLOC_ID"
|
echo "Stopping allocation to trigger fresh prestart: $ALLOC_ID"
|
||||||
curl -sf -X POST \
|
curl -sf -X POST \
|
||||||
-H "X-Nomad-Token: $NOMAD_TOKEN" \
|
-H "X-Nomad-Token: $NOMAD_TOKEN" \
|
||||||
"$NOMAD_ADDR/v1/client/allocation/$ALLOC_ID/restart"
|
"$NOMAD_ADDR/v1/allocation/$ALLOC_ID/stop"
|
||||||
echo "Deploy triggered — nginx will re-fetch index.html from git."
|
echo "Deploy triggered — Nomad will schedule a new alloc that re-fetches the site."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue