From 4830421e436fcf08dfa985f98277975e05175318 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 25 Jan 2026 12:25:01 +1100 Subject: [PATCH] benvin/artifactapi_2.0.5 (#40) Reviewed-on: https://git.unkin.net/unkin/packer-images/pulls/40 --- Makefile | 1 + builds/docker.pkr.hcl | 2 +- library/variables.pkr.hcl | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 01c934c..88be688 100644 --- a/Makefile +++ b/Makefile @@ -81,6 +81,7 @@ $(DIRS): # Build the image @(cd $(IMAGES_PATH)/$@ && \ export DATE=$(DATE_TAG) && \ + export VERSION=$$(cat version) && \ export OS_NAME=$$(echo $@ | cut -d'/' -f1) && \ export OS_VERSION_FULL=$$(echo $@ | cut -d'/' -f2) && \ export OS_IMAGE=$$(echo $@ | cut -d'/' -f3) && \ diff --git a/builds/docker.pkr.hcl b/builds/docker.pkr.hcl index 3a3f79e..b678371 100644 --- a/builds/docker.pkr.hcl +++ b/builds/docker.pkr.hcl @@ -64,7 +64,7 @@ build { post-processors { post-processor "docker-tag" { repository = "${var.docker_server}/unkin/${var.os_name}${var.os_version_major}-${var.os_image}" - tags = ["latest", var.date] + tags = ["latest", var.git_commit, var.version] } dynamic "post-processor" { diff --git a/library/variables.pkr.hcl b/library/variables.pkr.hcl index 2a08131..a56acdb 100644 --- a/library/variables.pkr.hcl +++ b/library/variables.pkr.hcl @@ -121,6 +121,11 @@ variable "git_branch" { type = string default = env("GIT_BRANCH") } +variable "version" { + description = "The version from version file." + type = string + default = env("VERSION") +} variable "include_incus_client_certs" { type = bool default = false