From 863b569a6141e9e9aeafe1ced472ffe9cd035382 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 6 Mar 2023 15:50:38 +0200 Subject: [PATCH] Fix blank changelist in kitmaker properties Signed-off-by: Evan Lezar --- build/container/Makefile | 1 + scripts/release-kitmaker-artifactory.sh | 2 ++ versions.mk | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build/container/Makefile b/build/container/Makefile index c0adc331..789365e2 100644 --- a/build/container/Makefile +++ b/build/container/Makefile @@ -95,6 +95,7 @@ $(BUILD_TARGETS): build-%: $(ARTIFACTS_ROOT) --build-arg PACKAGE_VERSION="$(PACKAGE_VERSION)" \ --build-arg VERSION="$(VERSION)" \ --build-arg GIT_COMMIT="$(GIT_COMMIT)" \ + --build-arg GIT_COMMIT_SHORT="$(GIT_COMMIT_SHORT)" \ --build-arg GIT_BRANCH="$(GIT_BRANCH)" \ --build-arg SOURCE_DATE_EPOCH="$(SOURCE_DATE_EPOCH)" \ --build-arg CVE_UPDATES="$(CVE_UPDATES)" \ diff --git a/scripts/release-kitmaker-artifactory.sh b/scripts/release-kitmaker-artifactory.sh index 7429e9f1..18f5501f 100755 --- a/scripts/release-kitmaker-artifactory.sh +++ b/scripts/release-kitmaker-artifactory.sh @@ -77,6 +77,7 @@ function extract_info() { IMAGE_EPOCH=$(extract_info "IMAGE_EPOCH") # Note we use the main branch for the kitmaker archive. GIT_BRANCH=main +GIT_COMMIT=$(extract_info "GIT_COMMIT") GIT_COMMIT_SHORT=$(extract_info "GIT_COMMIT_SHORT") VERSION=$(extract_info "PACKAGE_VERSION") @@ -169,6 +170,7 @@ function upload_archive() { # Package properties: props+=("package.epoch=${IMAGE_EPOCH}") props+=("package.version=${VERSION}") + props+=("package.commit=${GIT_COMMIT}") optionally_add_property "package.builds" "${package_builds}" for var in "CI_PROJECT_ID" "CI_PIPELINE_ID" "CI_JOB_ID" "CI_JOB_URL" "CI_PROJECT_PATH"; do diff --git a/versions.mk b/versions.mk index 9b1164d3..0ca71bca 100644 --- a/versions.mk +++ b/versions.mk @@ -34,6 +34,6 @@ CUDA_VERSION := 12.0.1 GOLANG_VERSION := 1.18.8 GIT_COMMIT ?= $(shell git describe --match="" --dirty --long --always --abbrev=40 2> /dev/null || echo "") -GIT_COMMIT_SHORT ?= $(shell git git rev-parse --short HEAD 2> /dev/null || echo "") +GIT_COMMIT_SHORT ?= $(shell git rev-parse --short HEAD 2> /dev/null || echo "") GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD 2> /dev/null || echo "${GIT_COMMIT}") SOURCE_DATE_EPOCH ?= $(shell git log -1 --format=%ct 2> /dev/null || echo "")