This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 93c49d340 Feat/add version (#4104)
93c49d340 is described below

commit 93c49d340abed388fc039c83ebff0e3788be9919
Author: Likyh <[email protected]>
AuthorDate: Wed Jan 4 21:35:16 2023 +0800

    Feat/add version (#4104)
    
    * fix: add tag/sha by github action
    
    * fix: fix typo
    
    * feat: show version in config-ui
---
 .github/workflows/build.yml         | 2 +-
 Dockerfile                          | 2 ++
 Makefile                            | 2 +-
 config-ui/src/layouts/base/base.tsx | 3 +++
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index b66e08c01..a0957a5ab 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -46,7 +46,7 @@ jobs:
           password: ${{ env.DOCKERHUB_TOKEN }}
       - name: Build lake image
         run: |
-          docker build -t ${{ env.IMAGE_LAKE }}:latest --file ./Dockerfile .
+          docker build --build-arg TAG=${{ github.ref_name }} --build-arg 
SHA=${{ github.sha }} -t ${{ env.IMAGE_LAKE }}:latest --file ./Dockerfile .
           docker tag ${{ env.IMAGE_LAKE }}:latest ${{ env.IMAGE_LAKE }}:${{ 
github.ref_name }}
           docker push ${{ env.IMAGE_LAKE }}:${{ github.ref_name }}
           if printf ${{ github.ref_name }} | grep -Pq '^v(\d+).(\d+).(\d+)$'; 
then
diff --git a/Dockerfile b/Dockerfile
index 601474892..bd559c314 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -30,6 +30,8 @@ ARG GOPROXY=
 # docker build --build-arg HTTPS_PROXY=http://localhost:4780 -t mericodev/lake 
.
 ARG HTTP_PROXY=
 ARG HTTPS_PROXY=
+ARG TAG=
+ARG SHA=
 
 WORKDIR /app
 COPY . /app
diff --git a/Makefile b/Makefile
index 9df8fb0e0..d3a66f756 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@
 # https://stackoverflow.com/questions/920413/make-error-missing-separator
 # https://tutorialedge.net/golang/makefiles-for-go-developers/
 
-SHA = $(shell git show -s --format=%h)
+SHA ?= $(shell git show -s --format=%h)
 TAG ?= $(shell git tag --points-at HEAD)
 IMAGE_REPO ?= "apache"
 VERSION = $(TAG)@$(SHA)
diff --git a/config-ui/src/layouts/base/base.tsx 
b/config-ui/src/layouts/base/base.tsx
index e26c8d8a6..a5c39ac64 100644
--- a/config-ui/src/layouts/base/base.tsx
+++ b/config-ui/src/layouts/base/base.tsx
@@ -28,6 +28,7 @@ import SlackLogo from '@/images/slack-rgb.svg';
 
 import { useMenu, MenuItemType } from './use-menu';
 import * as S from './styled';
+import { useVersion } from "@/store";
 
 interface Props {
   children: React.ReactNode;
@@ -37,6 +38,7 @@ export const BaseLayout = ({ children }: Props) => {
   const menu = useMenu();
   const { pathname } = useLocation();
   const history = useHistory();
+  const { version } = useVersion();
 
   const handlePushPath = (it: MenuItemType) => {
     if (!it.target) {
@@ -74,6 +76,7 @@ export const BaseLayout = ({ children }: Props) => {
           ))}
         </Menu>
         <div className="copyright">
+          <div>{version}</div>
           <span>Apache 2.0 License</span>
         </div>
       </S.Sider>

Reply via email to