From bd332a3dfbdc824ddf5015958344ce88c8e43e8c Mon Sep 17 00:00:00 2001 From: Trey Pendragon Date: Thu, 30 May 2024 14:03:56 -0700 Subject: [PATCH] Extract the branch to a variable. --- config/deploy/staging.hcl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/deploy/staging.hcl b/config/deploy/staging.hcl index 550626f5..f43ea23a 100644 --- a/config/deploy/staging.hcl +++ b/config/deploy/staging.hcl @@ -1,3 +1,7 @@ +variable "branch_or_sha" { + type = string + default = "main" +} job "dpulc-staging" { region = "global" datacenters = ["dc1"] @@ -25,7 +29,7 @@ job "dpulc-staging" { } driver = "docker" config { - image = "ghcr.io/pulibrary/dpul-collections:main" + image = "ghcr.io/pulibrary/dpul-collections:${ var.branch_or_sha }" command = "bash" args = ["-c", "/app/bin/migrate"] force_pull = true @@ -45,7 +49,7 @@ job "dpulc-staging" { task "webserver" { driver = "docker" config { - image = "ghcr.io/pulibrary/dpul-collections:main" + image = "ghcr.io/pulibrary/dpul-collections:${ var.branch_or_sha }" ports = ["http"] force_pull = true }