Fix update-api-version.sh for master branch (#24773)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/24606/head
congqixia 2023-06-09 13:10:35 +08:00 committed by GitHub
parent e81eb56b92
commit 93ee113c12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -9,6 +9,7 @@ if [ ! -d "$THIRD_PARTY_DIR/milvus-proto" ]; then
git clone https://github.com/milvus-io/milvus-proto.git
cd milvus-proto
API_VERSION=$(go list -m github.com/milvus-io/milvus-proto/go-api/v2 | awk -F' ' '{print $2}')
# try tagged version first
COMMIT_ID=$(git ls-remote https://github.com/milvus-io/milvus-proto.git refs/tags/${API_VERSION} | cut -f 1)
if [[ -z $COMMIT_ID ]]; then
# parse commit from pseudo version (eg v0.0.0-20230608062631-c453ef1b870a => c453ef1b870a)
@ -21,4 +22,4 @@ if [ ! -d "$THIRD_PARTY_DIR/milvus-proto" ]; then
git reset --hard $COMMIT_ID
fi
popd
fi
fi

View File

@ -16,12 +16,11 @@ if [[ $version == "" ]]; then
line
exit 1
fi
echo $(pwd)
commitID=$(git ls-remote https://github.com/milvus-io/milvus-proto.git refs/tags/${version} | cut -f 1)
line
echo "Update the milvus-proto/api/v2@${version}"
commitID=$(git ls-remote https://github.com/milvus-io/milvus-proto.git refs/heads/master | cut -f 1)
echo "Update the milvus-proto/go-api/v2@${version}"
if [[ $commitID == "" ]]; then
echo "${version} is not a valid tag, try to use it as commit ID"
commitID=$version
@ -39,6 +38,6 @@ line echo "Update the milvus-proto repo"
THIRD_PARTY_DIR=$SCRIPTS_DIR/../cmake_build/thirdparty
pushd $THIRD_PARTY_DIR/milvus-proto
git fetch
git checkout -b $version $commitID
popd
git fetch
git checkout -b $version $commitID
popd