mirror of https://github.com/tikv/client-java.git
improve build scripts (#186)
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
This commit is contained in:
parent
d469a2a10c
commit
b9736f6f18
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# Copyright 2017 PingCAP, Inc.
|
# Copyright 2017 PingCAP, Inc.
|
||||||
#
|
#
|
||||||
|
|
@ -14,32 +14,40 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
CURRENT_DIR=`pwd`
|
|
||||||
TIKV_CLIENT_HOME="$(cd "`dirname "$0"`"/..; pwd)"
|
|
||||||
cd $TIKV_CLIENT_HOME
|
|
||||||
|
|
||||||
kvproto_hash=6ed99a08e262d8a32d6355dcba91cf99cb92074a
|
kvproto_hash=6ed99a08e262d8a32d6355dcba91cf99cb92074a
|
||||||
|
|
||||||
raft_rs_hash=b9891b673573fad77ebcf9bbe0969cf945841926
|
raft_rs_hash=b9891b673573fad77ebcf9bbe0969cf945841926
|
||||||
|
|
||||||
tipb_hash=c4d518eb1d60c21f05b028b36729e64610346dac
|
tipb_hash=c4d518eb1d60c21f05b028b36729e64610346dac
|
||||||
|
|
||||||
if [ -d "kvproto" ]; then
|
kvproto_dir="kvproto"
|
||||||
cd kvproto; git fetch -p; git checkout ${kvproto_hash}; cd ..
|
raft_rs_dir="raft-rs"
|
||||||
else
|
tipb_dir="tipb"
|
||||||
git clone https://github.com/pingcap/kvproto; cd kvproto; git checkout ${kvproto_hash}; cd ..
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "raft-rs" ]; then
|
CURRENT_DIR=$(pwd)
|
||||||
cd raft-rs; git fetch -p; git checkout ${raft_rs_hash}; cd ..
|
TIKV_CLIENT_HOME="$(
|
||||||
else
|
cd "$(dirname "$0")"/.. || exit
|
||||||
git clone https://github.com/pingcap/raft-rs; cd raft-rs; git checkout ${raft_rs_hash}; cd ..
|
pwd
|
||||||
fi
|
)"
|
||||||
|
cd "$TIKV_CLIENT_HOME" || exit
|
||||||
|
|
||||||
if [ -d "tipb" ]; then
|
if [ -d "$kvproto_dir" ]; then
|
||||||
cd tipb; git fetch -p; git checkout ${tipb_hash}; cd ..
|
git -C ${kvproto_dir} fetch -p
|
||||||
else
|
else
|
||||||
git clone https://github.com/pingcap/tipb; cd tipb; git checkout ${tipb_hash}; cd ..
|
git clone https://github.com/pingcap/kvproto ${kvproto_dir}
|
||||||
fi
|
fi
|
||||||
|
git -C ${kvproto_dir} checkout ${kvproto_hash}
|
||||||
|
|
||||||
cd $CURRENT_DIR
|
if [ -d "$raft_rs_dir" ]; then
|
||||||
|
git -C ${raft_rs_dir} fetch -p
|
||||||
|
else
|
||||||
|
git clone https://github.com/pingcap/raft-rs ${raft_rs_dir}
|
||||||
|
fi
|
||||||
|
git -C ${raft_rs_dir} checkout ${raft_rs_hash}
|
||||||
|
|
||||||
|
if [ -d "$tipb_dir" ]; then
|
||||||
|
git -C ${tipb_dir} fetch -p
|
||||||
|
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