feat: replace date tag with git commit SHA and add version tag
All checks were successful
Build / build (pull_request) Successful in 15m30s

Replace date-based Docker tags with git commit SHA and version from version file.
This improves traceability by linking images to specific commits and versions.
This commit is contained in:
Ben Vincent 2026-01-25 11:53:27 +11:00
parent c6446a7fba
commit 81024ecc22
3 changed files with 7 additions and 1 deletions

View File

@ -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) && \

View File

@ -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" {

View File

@ -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