summaryrefslogtreecommitdiffstats
path: root/packaging/makeself/build-x86_64-static.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-07 11:45:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-07 11:45:55 +0000
commita8220ab2d293bb7f4b014b79d16b2fb05090fa93 (patch)
tree77f0a30f016c0925cf7ee9292e644bba183c2774 /packaging/makeself/build-x86_64-static.sh
parentAdding upstream version 1.19.0. (diff)
downloadnetdata-a8220ab2d293bb7f4b014b79d16b2fb05090fa93.tar.xz
netdata-a8220ab2d293bb7f4b014b79d16b2fb05090fa93.zip
Adding upstream version 1.29.0.upstream/1.29.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/makeself/build-x86_64-static.sh')
-rwxr-xr-xpackaging/makeself/build-x86_64-static.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/packaging/makeself/build-x86_64-static.sh b/packaging/makeself/build-x86_64-static.sh
new file mode 100755
index 000000000..83fa0dba9
--- /dev/null
+++ b/packaging/makeself/build-x86_64-static.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# shellcheck source=./packaging/installer/functions.sh
+. "$(dirname "$0")"/../installer/functions.sh || exit 1
+
+set -e
+
+DOCKER_CONTAINER_NAME="netdata-package-x86_64-static-alpine312"
+
+if ! docker inspect "${DOCKER_CONTAINER_NAME}" > /dev/null 2>&1; then
+ # To run interactively:
+ # docker run -it netdata-package-x86_64-static /bin/sh
+ # (add -v host-dir:guest-dir:rw arguments to mount volumes)
+ #
+ # To remove images in order to re-create:
+ # docker rm -v $(sudo docker ps -a -q -f status=exited)
+ # docker rmi netdata-package-x86_64-static
+ #
+ # This command maps the current directory to
+ # /usr/src/netdata.git
+ # inside the container and runs the script install-alpine-packages.sh
+ # (also inside the container)
+ #
+ run docker run -v "$(pwd)":/usr/src/netdata.git:rw alpine:3.12 \
+ /bin/sh /usr/src/netdata.git/packaging/makeself/install-alpine-packages.sh
+
+ # save the changes made permanently
+ id=$(docker ps -l -q)
+ run docker commit "${id}" "${DOCKER_CONTAINER_NAME}"
+fi
+
+# Run the build script inside the container
+if [ -t 1 ]; then
+ run docker run -a stdin -a stdout -a stderr -i -t -v \
+ "$(pwd)":/usr/src/netdata.git:rw \
+ "${DOCKER_CONTAINER_NAME}" \
+ /bin/sh /usr/src/netdata.git/packaging/makeself/build.sh "${@}"
+else
+ run docker run -v "$(pwd)":/usr/src/netdata.git:rw \
+ "${DOCKER_CONTAINER_NAME}" \
+ /bin/sh /usr/src/netdata.git/packaging/makeself/build.sh "${@}"
+fi
+
+if [ "${USER}" ]; then
+ sudo chown -R "${USER}" .
+fi