2022-10-09 14:28:59 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
function line()
|
|
|
|
{
|
|
|
|
echo "----------------------------"
|
|
|
|
}
|
|
|
|
|
2023-06-09 01:28:37 +08:00
|
|
|
version=$@
|
|
|
|
if [[ $version == "" ]]; then
|
|
|
|
echo "milvus/proto/go-api version not provided"
|
|
|
|
line
|
|
|
|
echo "example:"
|
|
|
|
echo " make update-milvus-api PROTO_API_VERSION=v2.3.0-dev.1"
|
|
|
|
echo "test with untagged commit:"
|
|
|
|
echo " make update-milvus-api PROTO_API_VERSION=\${commitID}"
|
|
|
|
line
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-06-09 13:10:35 +08:00
|
|
|
|
2023-06-09 01:28:37 +08:00
|
|
|
commitID=$(git ls-remote https://github.com/milvus-io/milvus-proto.git refs/tags/${version} | cut -f 1)
|
|
|
|
|
2022-10-09 14:28:59 +08:00
|
|
|
line
|
2023-06-09 13:10:35 +08:00
|
|
|
echo "Update the milvus-proto/go-api/v2@${version}"
|
2023-06-09 01:28:37 +08:00
|
|
|
if [[ $commitID == "" ]]; then
|
|
|
|
echo "${version} is not a valid tag, try to use it as commit ID"
|
|
|
|
commitID=$version
|
|
|
|
go get -u github.com/milvus-io/milvus-proto/go-api/v2@$commitID
|
|
|
|
else
|
|
|
|
go get -u github.com/milvus-io/milvus-proto/go-api/v2@$version
|
|
|
|
fi
|
2022-10-16 20:49:27 +08:00
|
|
|
|
|
|
|
SCRIPTS_DIR=$(dirname "$0")
|
|
|
|
EXAMPLE_DIR=$SCRIPTS_DIR/../cmake_build/thirdparty/protobuf/protobuf-src/examples
|
|
|
|
rm -rf $EXAMPLE_DIR
|
2022-10-19 20:45:32 +08:00
|
|
|
go mod tidy
|
|
|
|
|
|
|
|
line echo "Update the milvus-proto repo"
|
|
|
|
THIRD_PARTY_DIR=$SCRIPTS_DIR/../cmake_build/thirdparty
|
|
|
|
|
|
|
|
pushd $THIRD_PARTY_DIR/milvus-proto
|
2023-06-09 13:10:35 +08:00
|
|
|
git fetch
|
|
|
|
git checkout -b $version $commitID
|
|
|
|
popd
|