Skip to content

Commit

Permalink
fix: baking in version
Browse files Browse the repository at this point in the history
Signed-off-by: thediveo <[email protected]>
  • Loading branch information
thediveo committed Jan 17, 2024
1 parent 6776f8e commit 5368833
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ 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
$(GOGEN)
$(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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion defs_version.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion deployments/lxkns/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion web/lxkns/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_REACT_APP_GIT_VERSION=$REACT_APP_GIT_VERSION
VITE_REACT_APP_GIT_VERSION=0.0.0
2 changes: 1 addition & 1 deletion web/lxkns/src/views/about/About.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Logo from "app/lxkns.svg";
# <img src={Logo} style={{height: '2ex', position: 'relative', top: '0.3ex'}} /> Linux Kernel Namespaces Discovery

Version <span children={import.meta.env.VITE_REACT_APP_GIT_VERSION} /><br/>
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.
Expand Down

0 comments on commit 5368833

Please sign in to comment.