-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare
executable file
·54 lines (47 loc) · 1.45 KB
/
prepare
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
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
VERSION=""
HELP=0
POSITIONAL=()
BUILD_ONLY=0
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--help)
HELP=1
shift # past argument
;;
--build-only)
BUILD_ONLY=1
shift # past argument
;;
--version)
VERSION=$2
shift # past argument
shift # past value
;;
*)
POSITIONAL+=("$1")
ERROR "unknown option $1"
shift # past argument
;;
esac
done
if [ "${#POSITIONAL[@]}" -gt 0 ]; then
set -- "${POSITIONAL[@]}" # restore positional parameters
fi
if [ "${HELP}" -eq 1 ]; then
echo "Usage: $0 [OPTION]"
echo " --help Display this message"
echo " --build-only Build metasrv Java client only"
echo " --version Test databend package version"
exit 0
fi
if [ "${BUILD_ONLY}" -eq 0 ]; then
echo "Downloading ${VERSION} databend package..."
echo "https://github.com/datafuselabs/databend/releases/download/$VERSION-nightly/databend-$VERSION-nightly-x86_64-unknown-linux-musl.tar.gz -P docker/packages" | xargs wget
else
echo "Build meta java client only, no need to download databend package."
fi
echo "Build meta java client"
cd metasrv-java-client; gradle build; cp build/libs/*jar ../resources