forked from milvus-io/milvus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-api-version.sh
executable file
·43 lines (36 loc) · 1.15 KB
/
update-api-version.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
function line()
{
echo "----------------------------"
}
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
commitID=$(git ls-remote https://github.com/milvus-io/milvus-proto.git refs/tags/${version} | cut -f 1)
line
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
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
SCRIPTS_DIR=$(dirname "$0")
EXAMPLE_DIR=$SCRIPTS_DIR/../cmake_build/thirdparty/protobuf/protobuf-src/examples
rm -rf $EXAMPLE_DIR
go mod tidy
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