diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 11:08:07 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 11:08:07 +0000 |
commit | c69cb8cc094cc916adbc516b09e944cd3d137c01 (patch) | |
tree | f2878ec41fb6d0e3613906c6722fc02b934eeb80 /packaging/build_package_install_test.sh | |
parent | Initial commit. (diff) | |
download | netdata-c69cb8cc094cc916adbc516b09e944cd3d137c01.tar.xz netdata-c69cb8cc094cc916adbc516b09e944cd3d137c01.zip |
Adding upstream version 1.29.3.upstream/1.29.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/build_package_install_test.sh')
-rwxr-xr-x | packaging/build_package_install_test.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/packaging/build_package_install_test.sh b/packaging/build_package_install_test.sh new file mode 100755 index 0000000..e3b3362 --- /dev/null +++ b/packaging/build_package_install_test.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-3.0-or-later + +set -e + +# If we are not in netdata git repo, at the top level directory, FAIL +TOP_LEVEL=$(basename "$(git rev-parse --show-toplevel)") +CWD=$(git rev-parse --show-cdup || echo "") +if [ -n "${CWD}" ] || [ ! "${TOP_LEVEL}" = "netdata" ]; then + echo "Run as ./packaging/$(basename "$0") from top level directory of netdata git repository" + exit 1 +fi + +if [ $# -lt 2 ] || [ $# -gt 3 ]; then + echo "Usage: ./packaging/$(basename "$0") <distro> <distro_version> [<netdata_version>]" + exit 1 +fi + +if ! command -v docker > /dev/null; then + echo "Docker CLI not found. You need Docker to run this!" + exit 2 +fi + +DISTRO="$1" +DISTRO_VERSION="$2" +# TODO: Auto compute this? +VERSION="${3:-1.19.0}" + +TAG="netdata/netdata:${DISTRO}_${DISTRO_VERSION}" + +docker build \ + -f ./packaging/Dockerfile.packager \ + --build-arg DISTRO="$DISTRO" \ + --build-arg DISTRO_VERSION="$DISTRO_VERSION" \ + --build-arg VERSION="$VERSION" \ + -t "$TAG" . | + tee build.log |