Pārlūkot izejas kodu

Fix VERSION

tags/v0.15.0
Zhichang Yu pirms 10 mēnešiem
vecāks
revīzija
e267a026f3
3 mainītis faili ar 2 papildinājumiem un 18 dzēšanām
  1. 1
    1
      Dockerfile
  2. 1
    1
      api/versions.py
  3. 0
    16
      docker/update_version.sh

+ 1
- 1
Dockerfile Parādīt failu



COPY .git /ragflow/.git COPY .git /ragflow/.git


RUN version_info=$(git describe --tags --match=v* --always); \
RUN version_info=$(git describe --tags --match=v* --first-parent --always); \
if [ "$LIGHTEN" == "1" ]; then \ if [ "$LIGHTEN" == "1" ]; then \
version_info="$version_info slim"; \ version_info="$version_info slim"; \
else \ else \

+ 1
- 1
api/versions.py Parādīt failu

try: try:
# Get the current commit hash # Get the current commit hash
version_info = ( version_info = (
subprocess.check_output(["git", "describe", "--tags", "--match=v*", "--always"])
subprocess.check_output(["git", "describe", "--tags", "--match=v*", "--first-parent", "--always"])
.strip() .strip()
.decode("utf-8") .decode("utf-8")
) )

+ 0
- 16
docker/update_version.sh Parādīt failu

# update RAGFlow version
# Get the latest tag
last_tag=$(git describe --tags --abbrev=0)
# Get the number of commits from the last tag
commit_count=$(git rev-list --count "$last_tag..HEAD")
# Get the short commit id
last_commit=$(git rev-parse --short HEAD)

version_info=""
if [ "$commit_count" -eq 0 ]; then
version_info=$last_tag
else
printf -v version_info "%s(%s~%d)" "$last_commit" "$last_tag" $commit_count
fi
# Replace the version in the versions.py file
sed -i "s/\"dev\"/\"$version_info\"/" api/versions.py

Notiek ielāde…
Atcelt
Saglabāt