summaryrefslogtreecommitdiffstats
path: root/.github/scripts/pkg-test.sh
diff options
context:
space:
mode:
Diffstat (limited to '.github/scripts/pkg-test.sh')
-rwxr-xr-x.github/scripts/pkg-test.sh36
1 files changed, 33 insertions, 3 deletions
diff --git a/.github/scripts/pkg-test.sh b/.github/scripts/pkg-test.sh
index e3bc3e7d..45b8c320 100755
--- a/.github/scripts/pkg-test.sh
+++ b/.github/scripts/pkg-test.sh
@@ -13,6 +13,7 @@ install_debian_like() {
apt-get update
# Install Netdata
+ # Strange quoting is required here so that glob matching works.
apt-get install -y /netdata/artifacts/netdata_"${VERSION}"*_*.deb || exit 1
# Install testing tools
@@ -27,8 +28,13 @@ install_fedora_like() {
pkg_version="$(echo "${VERSION}" | tr - .)"
+ if [ "${PKGMGR}" = "dnf" ]; then
+ opts="--allowerasing"
+ fi
+
# Install Netdata
- "$PKGMGR" install -y /netdata/artifacts/netdata-"${pkg_version}"-*.rpm
+ # Strange quoting is required here so that glob matching works.
+ "$PKGMGR" install -y /netdata/artifacts/netdata-"${pkg_version}"-*.rpm || exit 1
# Install testing tools
"$PKGMGR" install -y curl nc jq || exit 1
@@ -50,9 +56,29 @@ install_centos() {
"$PKGMGR" install -y epel-release || exit 1
# Install Netdata
- "$PKGMGR" install -y /netdata/artifacts/netdata-"${pkg_version}"-*.rpm
+ # Strange quoting is required here so that glob matching works.
+ "$PKGMGR" install -y /netdata/artifacts/netdata-"${pkg_version}"-*.rpm || exit 1
# Install testing tools
+ # shellcheck disable=SC2086
+ "$PKGMGR" install -y ${opts} curl nc jq || exit 1
+}
+
+install_amazon_linux() {
+ PKGMGR="$( (command -v dnf > /dev/null && echo "dnf") || echo "yum")"
+
+ pkg_version="$(echo "${VERSION}" | tr - .)"
+
+ if [ "${PKGMGR}" = "dnf" ]; then
+ opts="--allowerasing"
+ fi
+
+ # Install Netdata
+ # Strange quoting is required here so that glob matching works.
+ "$PKGMGR" install -y /netdata/artifacts/netdata-"${pkg_version}"-*.rpm || exit 1
+
+ # Install testing tools
+ # shellcheck disable=SC2086
"$PKGMGR" install -y ${opts} curl nc jq || exit 1
}
@@ -63,7 +89,8 @@ install_suse_like() {
pkg_version="$(echo "${VERSION}" | tr - .)"
# Install Netdata
- zypper install -y --allow-unsigned-rpm /netdata/artifacts/netdata-"${pkg_version}"-*.rpm
+ # Strange quoting is required here so that glob matching works.
+ zypper install -y --allow-unsigned-rpm /netdata/artifacts/netdata-"${pkg_version}"-*.rpm || exit 1
# Install testing tools
zypper install -y --no-recommends curl netcat-openbsd jq || exit 1
@@ -114,6 +141,9 @@ case "${DISTRO}" in
centos | rockylinux | almalinux)
install_centos
;;
+ amazonlinux)
+ install_amazon_linux
+ ;;
opensuse)
install_suse_like
;;