You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ab...@apache.org on 2024/09/20 07:54:04 UTC
(incubator-devlake) branch bugfix-version-tag updated: fix: version tag
This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch bugfix-version-tag
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/bugfix-version-tag by this push:
new 650ee558a fix: version tag
650ee558a is described below
commit 650ee558ae7d2e71c99244d017530e0b36ad8920
Author: abeizn <zi...@merico.dev>
AuthorDate: Fri Sep 20 15:53:54 2024 +0800
fix: version tag
---
Makefile | 4 ++--
backend/Makefile | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 9417f6505..0d93a0d3e 100644
--- a/Makefile
+++ b/Makefile
@@ -17,8 +17,8 @@
# https://stackoverflow.com/questions/920413/make-error-missing-separator
# https://tutorialedge.net/golang/makefiles-for-go-developers/
-SHA := $(shell if [ -d .git ]; then git show -s --format=%h; else echo "default_SHA"; fi)
-TAG := $(shell if [ -d .git ]; then git tag --points-at HEAD; else echo "default_TAG"; fi)
+SHA := $(shell git show -s --format=%h 2>/dev/null || echo "default_SHA")
+TAG := $(shell git tag --points-at HEAD 2>/dev/null || echo "default_TAG")
IMAGE_REPO ?= "apache"
VERSION = $(TAG)@$(SHA)
diff --git a/backend/Makefile b/backend/Makefile
index bb321473c..d3b0db10f 100644
--- a/backend/Makefile
+++ b/backend/Makefile
@@ -17,8 +17,8 @@
# https://stackoverflow.com/questions/920413/make-error-missing-separator
# https://tutorialedge.net/golang/makefiles-for-go-developers/
-SHA := $(shell if [ -d .git ]; then git show -s --format=%h; else echo "default_SHA"; fi)
-TAG := $(shell if [ -d .git ]; then git tag --points-at HEAD; else echo "default_TAG"; fi)
+SHA := $(shell git show -s --format=%h 2>/dev/null || echo "default_SHA")
+TAG := $(shell git tag --points-at HEAD 2>/dev/null || echo "default_TAG")
IMAGE_REPO ?= "apache"
VERSION = $(TAG)@$(SHA)
PYTHON_DIR ?= "./python"