| 1 | #!/bin/bash |
| 2 | # SPDX-License-Identifier: GPL-3.0-or-later |
| 3 | |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | # parse command line arguments |
| 6 | |
| 7 | set -e |
| 8 | |
| 9 | export NETDATA_BUILD_WITH_DEBUG=0 |
| 10 | |
| 11 | while [ -n "${1}" ]; do |
| 12 | case "${1}" in |
| 13 | debug) |
| 14 | export NETDATA_BUILD_WITH_DEBUG=1 |
| 15 | ;; |
| 16 | |
| 17 | *) ;; |
| 18 | |
| 19 | esac |
| 20 | |
| 21 | shift |
| 22 | done |
| 23 | |
| 24 | # ----------------------------------------------------------------------------- |
| 25 | |
| 26 | cd /netdata/packaging/makeself || exit 1 |
| 27 | |
| 28 | cat >&2 << EOF |
| 29 | This program will create a self-extracting shell package containing |
| 30 | a statically linked netdata, able to run on any 64bit Linux system, |
| 31 | without any dependencies from the target system. |
| 32 | |
| 33 | It can be used to have netdata running in no-time, or in cases the |
| 34 | target Linux system cannot compile netdata. |
| 35 | EOF |
| 36 | |
| 37 | if [ -z "${GITHUB_ACTIONS}" ]; then |
| 38 | export GITHUB_ACTIONS=false |
| 39 | fi |
| 40 | |
| 41 | mkdir -p /netdata/artifacts |
| 42 | chown "$(stat -c '%u:%g' /netdata)" /netdata/artifacts/ |
| 43 | |
| 44 | if ! ./run-all-jobs.sh "$@"; then |
| 45 | printf >&2 "Build failed." |
| 46 | |
| 47 | if [ -n "${DEBUG_BUILD_INFRA}" ]; then |
| 48 | exec /bin/bash |
| 49 | else |
| 50 | exit 1 |
| 51 | fi |
| 52 | fi |