zhichyu commited on
Commit
fa89227
·
1 Parent(s): 3bbcfdd

Fix VERSION

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. api/versions.py +1 -1
  3. docker/update_version.sh +0 -16
Dockerfile CHANGED
@@ -120,7 +120,7 @@ RUN --mount=type=cache,id=ragflow_npm,target=/root/.npm,sharing=locked \
120
 
121
  COPY .git /ragflow/.git
122
 
123
- RUN version_info=$(git describe --tags --match=v* --always); \
124
  if [ "$LIGHTEN" == "1" ]; then \
125
  version_info="$version_info slim"; \
126
  else \
 
120
 
121
  COPY .git /ragflow/.git
122
 
123
+ RUN version_info=$(git describe --tags --match=v* --first-parent --always); \
124
  if [ "$LIGHTEN" == "1" ]; then \
125
  version_info="$version_info slim"; \
126
  else \
api/versions.py CHANGED
@@ -43,7 +43,7 @@ def get_closest_tag_and_count():
43
  try:
44
  # Get the current commit hash
45
  version_info = (
46
- subprocess.check_output(["git", "describe", "--tags", "--match=v*", "--always"])
47
  .strip()
48
  .decode("utf-8")
49
  )
 
43
  try:
44
  # Get the current commit hash
45
  version_info = (
46
+ subprocess.check_output(["git", "describe", "--tags", "--match=v*", "--first-parent", "--always"])
47
  .strip()
48
  .decode("utf-8")
49
  )
docker/update_version.sh DELETED
@@ -1,16 +0,0 @@
1
- # update RAGFlow version
2
- # Get the latest tag
3
- last_tag=$(git describe --tags --abbrev=0)
4
- # Get the number of commits from the last tag
5
- commit_count=$(git rev-list --count "$last_tag..HEAD")
6
- # Get the short commit id
7
- last_commit=$(git rev-parse --short HEAD)
8
-
9
- version_info=""
10
- if [ "$commit_count" -eq 0 ]; then
11
- version_info=$last_tag
12
- else
13
- printf -v version_info "%s(%s~%d)" "$last_commit" "$last_tag" $commit_count
14
- fi
15
- # Replace the version in the versions.py file
16
- sed -i "s/\"dev\"/\"$version_info\"/" api/versions.py