master
sh 46 lines 826 Bytes
Raw
1 #!/bin/sh
2 #
3 # Builds the netdata-vX.Y.Z-xxxx.gz.run (static x86_64) artifact.
4
5 set -e
6
7 # shellcheck source=.github/scripts/functions.sh
8 . "$(dirname "$0")/functions.sh"
9
10 BUILDARCH="${1}"
11 NAME="${NAME:-netdata}"
12 VERSION="${VERSION:-"$(git describe)"}"
13 BASENAME="$NAME-$BUILDARCH-$VERSION"
14
15 prepare_build() {
16 test -d artifacts || mkdir -p artifacts
17 }
18
19 build_static() {
20 USER="" ./packaging/makeself/build-static.sh "${BUILDARCH}"
21 }
22
23 prepare_assets() {
24 cp packaging/version artifacts/latest-version.txt
25 }
26
27 steps="prepare_build build_static"
28 steps="$steps prepare_assets"
29
30 _main() {
31 for step in $steps; do
32 if ! run "$step"; then
33 if [ -t 1 ]; then
34 debug
35 else
36 fail "Build failed"
37 fi
38 fi
39 done
40
41 echo "🎉 All Done!"
42 }
43
44 if [ -n "$0" ] && [ x"$0" != x"-bash" ]; then
45 _main "$@"
46 fi