mirror of https://github.com/milvus-io/milvus.git
Fix update-api-version.sh for master branch (#24773)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>pull/24606/head
parent
e81eb56b92
commit
93ee113c12
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue