From 5368833d229bed43b3916b86171255b0d81f1ef3 Mon Sep 17 00:00:00 2001 From: thediveo Date: Wed, 17 Jan 2024 15:55:00 +0100 Subject: [PATCH] fix: baking in version Signed-off-by: thediveo --- Makefile | 8 ++++---- defs_version.go | 2 +- deployments/lxkns/Dockerfile | 3 ++- web/lxkns/.env | 2 +- web/lxkns/src/views/about/About.mdx | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 4b4a2554..5e35abc7 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ dist: ## build multi-arch image (amd64, arm64) and push to local running registr $(GOGEN) $(eval GIT_VERSION := $(shell $(GET_SEMVERSION))) scripts/multiarch-builder.sh \ - --build-arg GIT_VERSION=$(GIT_VERSION) \ + --build-arg REACT_APP_GIT_VERSION=$(GIT_VERSION) \ --build-context webappsrc=./web/lxkns deploy: ## deploys lxkns service on host port 5010 @@ -60,7 +60,7 @@ deploy: ## deploys lxkns service on host port 5010 $(eval GIT_VERSION := $(shell $(GET_SEMVERSION))) scripts/docker-build.sh deployments/lxkns/Dockerfile \ -t lxkns \ - --build-arg GIT_VERSION=$(GIT_VERSION) \ + --build-arg REACT_APP_GIT_VERSION=$(GIT_VERSION) \ --build-context webappsrc=./web/lxkns docker compose -p lxkns -f deployments/lxkns/docker-compose.yaml up @@ -82,13 +82,13 @@ buildapp: ## builds web UI app $(GOGEN) $(eval GIT_VERSION := $(shell $(GET_SEMVERSION))) @echo "building version" $(GIT_VERSION) - @cd web/lxkns && GIT_VERSION=$(GIT_VERSION) yarn build + @cd web/lxkns && sed -i "s/^VITE_REACT_APP_GIT_VERSION=.*/VITE_REACT_APP_GIT_VERSION=$$GIT_VERSION/" .env && yarn build startapp: ## starts web UI app for development $(GOGEN) $(eval GIT_VERSION := $(shell $(GET_SEMVERSION))) @echo "starting version" $(GIT_VERSION) - @cd web/lxkns && GIT_VERSION=$(GIT_VERSION) yarn start + @cd web/lxkns && sed -i "s/^VITE_REACT_APP_GIT_VERSION=.*/VITE_REACT_APP_GIT_VERSION=$$GIT_VERSION/" .env && yarn build scan: ## scans the repository for CVEs @scripts/scan.sh diff --git a/defs_version.go b/defs_version.go index 97d59b4b..bdc49587 100644 --- a/defs_version.go +++ b/defs_version.go @@ -4,4 +4,4 @@ package lxkns // SemVersion is the semantic version string of the lxkns module. -const SemVersion = "0.31.1" +const SemVersion = "0.32.2-2-g6776f8e" diff --git a/deployments/lxkns/Dockerfile b/deployments/lxkns/Dockerfile index b8480a22..42cedf70 100644 --- a/deployments/lxkns/Dockerfile +++ b/deployments/lxkns/Dockerfile @@ -140,7 +140,8 @@ RUN yarn eslint --init COPY --from=webappsrc public/ ./public/ COPY --from=webappsrc src/ ./src/ COPY --from=webappsrc .env ./ -ARG GIT_VERSION +ARG REACT_APP_GIT_VERSION +RUN sed -i "s/^VITE_REACT_APP_GIT_VERSION=.*/VITE_REACT_APP_GIT_VERSION=${REACT_APP_GIT_VERSION}/" .env RUN yarn build # 3rd and final stage: create the final image containing only the lxkns binary diff --git a/web/lxkns/.env b/web/lxkns/.env index 356c9c7c..3285b3ec 100644 --- a/web/lxkns/.env +++ b/web/lxkns/.env @@ -1 +1 @@ -VITE_REACT_APP_GIT_VERSION=$REACT_APP_GIT_VERSION +VITE_REACT_APP_GIT_VERSION=0.0.0 diff --git a/web/lxkns/src/views/about/About.mdx b/web/lxkns/src/views/about/About.mdx index a0c3bdbf..c8c3486d 100644 --- a/web/lxkns/src/views/about/About.mdx +++ b/web/lxkns/src/views/about/About.mdx @@ -3,7 +3,7 @@ import Logo from "app/lxkns.svg"; # Linux Kernel Namespaces Discovery Version
-Copyright 2020–23 Harald Albrecht +Copyright 2020–24 Harald Albrecht This "app" lets you easily see and explore the Linux-kernel namespaces in your host system.