From 4c5b20a22d04cab83f0bac92a96f7c8244db5379 Mon Sep 17 00:00:00 2001 From: jooho lee Date: Thu, 28 Nov 2024 11:36:43 -0500 Subject: [PATCH] fix build-version issue Signed-off-by: jooho lee --- Dockerfile.konflux | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile.konflux b/Dockerfile.konflux index d4c5c83a..b0913997 100644 --- a/Dockerfile.konflux +++ b/Dockerfile.konflux @@ -19,6 +19,10 @@ RUN echo "$PNC_FILES_JSON" | jq -r '.[] | select(test("\\.zip$"))' | \ while read url; do wget --no-check-certificate "$url"; done && \ for file in *.zip; do unzip -d /root/ "$file"; done +# Assume that source code comes from a Git repository +RUN echo "$(date '+%Y%m%d')-$(git rev-parse HEAD | cut -c -5)" > target/dockerhome/build-version && \ + echo "$(git rev-parse HEAD)" > target/dockerhome/release && \ + echo "$(git branch --show-current|sed 's/^release-//g')-$(git branch --show-current)_$(date '+%Y%m%d')-$(git rev-parse HEAD | cut -c -5)" > target/dockerhome/version ############################################################################### #latest tag @@ -45,7 +49,6 @@ RUN sed -i 's:security.provider.12=SunPKCS11:#security.provider.12=SunPKCS11:g' COPY --from=stage root/target/dockerhome/ /opt/kserve/mmesh/ COPY --from=stage root/target/dockerhome/version /etc/modelmesh-version - # Make this the current directory when starting the container WORKDIR /opt/kserve/mmesh