mirror of https://github.com/tikv/client-java.git
This commit is contained in:
parent
7a123a07e2
commit
660199a2d2
52
dev/proto.sh
52
dev/proto.sh
|
|
@ -14,43 +14,27 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
kvproto_hash=58f2ac94aa38f49676dd628fbcc1d669a77a62ac
|
proto_dir="proto"
|
||||||
raft_rs_hash=b9891b673573fad77ebcf9bbe0969cf945841926
|
|
||||||
tipb_hash=c4d518eb1d60c21f05b028b36729e64610346dac
|
|
||||||
|
|
||||||
kvproto_dir="kvproto"
|
if [ -d $proto_dir ]; then
|
||||||
raft_rs_dir="raft-rs"
|
rm -r $proto_dir
|
||||||
tipb_dir="tipb"
|
|
||||||
|
|
||||||
CURRENT_DIR=$(pwd)
|
|
||||||
TIKV_CLIENT_HOME="$(
|
|
||||||
cd "$(dirname "$0")"/.. || exit
|
|
||||||
pwd
|
|
||||||
)"
|
|
||||||
cd "$TIKV_CLIENT_HOME" || exit
|
|
||||||
|
|
||||||
if [ -d "$kvproto_dir" ]; then
|
|
||||||
git -C ${kvproto_dir} fetch -p
|
|
||||||
git pull --all
|
|
||||||
else
|
|
||||||
git clone https://github.com/pingcap/kvproto ${kvproto_dir}
|
|
||||||
fi
|
fi
|
||||||
git -C ${kvproto_dir} checkout ${kvproto_hash}
|
|
||||||
|
|
||||||
if [ -d "$raft_rs_dir" ]; then
|
repos=("https://github.com/pingcap/kvproto" "https://github.com/pingcap/raft-rs" "https://github.com/pingcap/tipb")
|
||||||
git -C ${raft_rs_dir} fetch -p
|
commits=(58f2ac94aa38f49676dd628fbcc1d669a77a62ac b9891b673573fad77ebcf9bbe0969cf945841926 c4d518eb1d60c21f05b028b36729e64610346dac)
|
||||||
git pull --all
|
|
||||||
|
for i in "${!repos[@]}"; do
|
||||||
|
repo_name=$(basename ${repos[$i]})
|
||||||
|
git_command="git -C $repo_name"
|
||||||
|
|
||||||
|
if [ -d "$repo_name" ]; then
|
||||||
|
$git_command checkout `basename $($git_command symbolic-ref --short refs/remotes/origin/HEAD)`
|
||||||
|
$git_command fetch --all
|
||||||
|
$git_command pull --all
|
||||||
else
|
else
|
||||||
git clone https://github.com/pingcap/raft-rs ${raft_rs_dir}
|
git clone ${repos[$i]} $repo_name
|
||||||
|
$git_command fetch -p
|
||||||
fi
|
fi
|
||||||
git -C ${raft_rs_dir} checkout ${raft_rs_hash}
|
|
||||||
|
|
||||||
if [ -d "$tipb_dir" ]; then
|
$git_command checkout ${commits[$i]}
|
||||||
git -C ${tipb_dir} fetch -p
|
done
|
||||||
git pull --all
|
|
||||||
else
|
|
||||||
git clone https://github.com/pingcap/tipb ${tipb_dir}
|
|
||||||
fi
|
|
||||||
git -C ${tipb_dir} checkout ${tipb_hash}
|
|
||||||
|
|
||||||
cd "$CURRENT_DIR" || exit
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue