fix(deploy): use SHA image tag instead of latest in Nomad
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 42s
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 42s
Avoids stale image cache issues where Nomad re-uses the old :latest layer. SHA is injected via nomad -var flag at deploy time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,8 +40,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Deploy to Nomad
|
- name: Deploy to Nomad
|
||||||
run: |
|
run: |
|
||||||
nomad job validate ${SERVICE_NAME}.nomad
|
SHA=$(git rev-parse --short HEAD)
|
||||||
nomad job run ${SERVICE_NAME}.nomad
|
nomad job validate -var="image_tag=$SHA" ${SERVICE_NAME}.nomad
|
||||||
|
nomad job run -var="image_tag=$SHA" ${SERVICE_NAME}.nomad
|
||||||
env:
|
env:
|
||||||
NOMAD_ADDR: "https://nomad.i80.dk:4646"
|
NOMAD_ADDR: "https://nomad.i80.dk:4646"
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
variable "image_tag" {
|
||||||
|
type = string
|
||||||
|
default = "latest"
|
||||||
|
}
|
||||||
|
|
||||||
job "citti" {
|
job "citti" {
|
||||||
region = "global"
|
region = "global"
|
||||||
datacenters = ["dc1"]
|
datacenters = ["dc1"]
|
||||||
@@ -74,7 +79,7 @@ job "citti" {
|
|||||||
driver = "docker"
|
driver = "docker"
|
||||||
|
|
||||||
config {
|
config {
|
||||||
image = "registry.i80.dk/gitea/citti:latest"
|
image = "registry.i80.dk/gitea/citti:${var.image_tag}"
|
||||||
ports = ["http"]
|
ports = ["http"]
|
||||||
force_pull = true
|
force_pull = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user