-
Notifications
You must be signed in to change notification settings - Fork 8
/
release.sh
executable file
·60 lines (50 loc) · 1.39 KB
/
release.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
BUILD=$SCRIPT_DIR/build.sh
PACKAGE=$SCRIPT_DIR/package.sh
function usage() {
cat << EOF
builds binary and creates installation packages for all supported platforms
$0 [OPTIONS]
options:
-r, --release: release version used for packages (can be different from version for development releases)
-v, --version: xk6-disruptor version in semver format
EOF
}
# Prints an error message the usage help and exits with error
function error () {
echo $1
usage
exit 1
}
while [[ $# -gt 0 ]]; do
case $1 in
-r|--release)
RELEASE="$2"
shift
;;
-v|--version)
VERSION="-v $2"
shift
;;
*)
error "Unknown option $1"
;;
esac
shift
done
if [[ -z $RELEASE ]]; then
error "release is required"
fi
$BUILD -o linux -a amd64 $VERSION
$BUILD -o linux -a arm64 $VERSION
$BUILD -o darwin -a amd64 $VERSION
$BUILD -o darwin -a arm64 $VERSION
$BUILD -o windows -a amd64 $VERSION -y xk6-disruptor-windows-amd64.exe
$PACKAGE -o linux -a amd64 -p deb -r $RELEASE
$PACKAGE -o linux -a amd64 -p rpm -r $RELEASE
$PACKAGE -o linux -a amd64 -p tgz -r $RELEASE
$PACKAGE -o linux -a arm64 -p tgz -r $RELEASE
$PACKAGE -o darwin -a amd64 -p tgz -r $RELEASE
$PACKAGE -o darwin -a arm64 -p tgz -r $RELEASE
$PACKAGE -o windows -a amd64 -p zip -r $RELEASE -y xk6-disruptor-windows-amd64.exe