forked from honeycombio/refinery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-pkg.sh
executable file
·43 lines (37 loc) · 886 Bytes
/
build-pkg.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
#!/bin/bash
# Build deb or rpm packages for Refinery.
set -e
function usage() {
echo "Usage: build-pkg.sh -m <arch> -v <version> -t <package_type>"
exit 2
}
while getopts "v:t:m:" opt; do
case "$opt" in
v)
version=$OPTARG
;;
t)
pkg_type=$OPTARG
;;
m)
arch=$OPTARG
;;
esac
done
if [ -z "$pkg_type" ] || [ -z "$arch" ]; then
usage
fi
if [ -z "$version" ]; then
version=v0.0.0-dev
fi
fpm -s dir -n refinery \
-m "Honeycomb <[email protected]>" \
-v ${version#v} \
-t $pkg_type \
-a $arch \
--pre-install=./preinstall \
$GOPATH/bin/refinery-linux-${arch}=/usr/bin/refinery \
./refinery.upstart=/etc/init/refinery.conf \
./refinery.service=/lib/systemd/system/refinery.service \
./config.toml=/etc/refinery/refinery.toml \
./rules.toml=/etc/refinery/rules.toml