diff --git a/scripts/download_milvus_proto.sh b/scripts/download_milvus_proto.sh index 0ec0c72a51..e17eea5543 100755 --- a/scripts/download_milvus_proto.sh +++ b/scripts/download_milvus_proto.sh @@ -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 \ No newline at end of file +fi diff --git a/scripts/update-api-version.sh b/scripts/update-api-version.sh index 82d5efa75a..da413217a6 100755 --- a/scripts/update-api-version.sh +++ b/scripts/update-api-version.sh @@ -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 \ No newline at end of file + git fetch + git checkout -b $version $commitID +popd