-
Notifications
You must be signed in to change notification settings - Fork 168
/
package_linux.sh
executable file
·47 lines (37 loc) · 1.02 KB
/
package_linux.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
#!/bin/bash
# exit on error
set -e
nobuild=0
if [ "$1" != "" ]; then
if [ "$1" = "--no-build" ]; then
nobuild=1
fi
fi
echo "# Getting branch info"
git status -bs
builddir="$(pwd)"/build
mkdir -p "$builddir"/binaries "$builddir"/package "$builddir"/tar "$builddir"/release
version=$(git describe --tag --abbrev=4 | sed 's/^v//')
head=$(git rev-parse --short HEAD)
epoch=$(date +%s)
release=1
description="Replication Manager for MariaDB and MySQL"
maintainer="info@signal18.io"
license="GPLv3"
architecture=${architecture:-amd64}
if [ $nobuild -eq 0 ]; then
echo "# Building for $architecture"
ARCH=$architecture make
fi
export version
echo "# Cleaning up previous builds"
rm -rf "$builddir"/package/* "$builddir"/tar/* "$builddir"/release/*
mkdir -p "$builddir"/package/usr/bin
echo "# Building packages"
for type in deb rpm; do
for config in client osc prov arbitrator; do
nfpm pkg --packager $type --config nfpm/$config.yaml --target build/release/
done
done
echo "# Build complete"
rm -rf "$builddir"/package/