Lets go back

This commit is contained in:
2024-12-13 22:19:08 +01:00
parent 70df58a097
commit 7a6cf87e3e
2 changed files with 9 additions and 29 deletions

View File

@@ -35,29 +35,6 @@ jobs:
NOMAD_ADDR: https://nomad.i80.dk
run: nomad job validate .gitea/workflows/nomad-job.hcl
- name: Apply Nomad Job
env:
NOMAD_ADDR: https://nomad.i80.dk
run: nomad job run .gitea/workflows/nomad-job.hcl
- name: Wait for New Job to Become Healthy
env:
NOMAD_ADDR: https://nomad.i80.dk
run: |
echo "Waiting for the new job to become healthy..."
# Fetch the latest allocation ID for the job
NEW_ALLOC=$(nomad job status lifefaq | awk '/ID/ {getline; print $1}' | tail -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 "New allocation is healthy!"
- name: Stop old deployment
env:
NOMAD_ADDR: https://nomad.i80.dk
@@ -65,7 +42,10 @@ jobs:
continue-on-error: true
- name: Apply Nomad Job
env:
NOMAD_ADDR: https://nomad.i80.dk
run: nomad job run .gitea/workflows/nomad-job.hcl
- name: Update Nginx Configuration
run: ssh runner@nomad sudo /opt/nginx_updater/venv/bin/python3 /opt/nginx_updater/nginx_updater.py lifefaq