From 87b10611e78453d5398139a0a1d5e97d4d9effa8 Mon Sep 17 00:00:00 2001 From: Henrik Jess Nielsen Date: Fri, 13 Dec 2024 22:12:03 +0100 Subject: [PATCH] Trying something ... --- .gitea/workflows/main.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 23235ce..7a55f37 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -45,11 +45,18 @@ jobs: NOMAD_ADDR: https://nomad.i80.dk run: | echo "Waiting for the new job to become healthy..." - until nomad job status lifefaq | grep -q "healthy"; do - echo "Job not healthy yet, retrying..." + + # Fetch the latest allocation ID for the job + NEW_ALLOC=$(nomad job status lifefaq | awk '/ID/ {getline; print $1}' | head -n 1) + echo "Latest allocation ID: $NEW_ALLOC" + + # Wait for the new allocation to become healthy + until nomad alloc status $NEW_ALLOC | grep -q "Client Status.*running"; do + echo "New allocation not healthy yet, retrying..." sleep 5 done - echo "Job is healthy!" + + echo "New allocation is healthy!" - name: Stop old deployment env: -- 2.39.5