mirror of
https://github.com/netdata/netdata.git
synced 2025-04-17 19:22:40 +00:00
netdata/packaging: Add more distribution validations (#6235)
* netdata/packaging: Add more distribution validations As an attempt to increase our coverage in testing and to guarantee cross-distribution stability, we choose to extend our baseline tests across all currently supported distributions. We run the stable to current transition test, to maximize scenarios coverage. The missing distributions from the bare OS runs, are covered on the Artifacts validations stage * netdata/packaging: adjust update lifecycle test to be more agile 1) use required packages during setup, to guarantee all stuff there cross-distro 2) add opensuse on entry point script 3) Only bats and curl will be installed prior to the tests. The rest are from the deps script * netdata/packaging: Use the right id for version checking, its opensuse-leap not opensuse * netdata/packaging: small adjustments 1) move deps script outside the bats process 2) don't install curl, we expect it to be there 3) fix tumbleweed tag, it was wrong (duh) * netdata/packaging: wrong place, trigger depedency after curl and bats install. Also, blind install for weird archlinux case missing grep * netdata/packaging: missed one more OS identifier * netdata/packaging: Handle alpine case * netdata/packaging: unattended execution flags * netdata/packaging: its a never ending story.. early install of bash for alpine, to get our job done then * netdata/packaging: fix docker runs - multiple commands should be within the container, just using && doesn't send them to the container, second command rather runs on the host * netdata/packaging: Run sh for the main test script, then trigger bash install within for alpine so that the rest of the process runs smoothly
This commit is contained in:
parent
3caedbad6c
commit
08666d9023
3 changed files with 85 additions and 8 deletions
43
.travis.yml
43
.travis.yml
|
@ -242,7 +242,7 @@ jobs:
|
|||
- echo "packaging/version:" && cat packaging/version
|
||||
- docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" make clean || echo "Nothing to clean"
|
||||
- docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" make distclean || echo "Nothing to distclean"
|
||||
- docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" autoreconf -ivf && ./configure --prefix=/netdata_install/usr --sysconfdir=/netdata_install/etc --localstatedir=/netdata_install/var --with-zlib --with-math --with-user=netdata CFLAGS=-O2
|
||||
- docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" /bin/bash -c "autoreconf -ivf && ./configure --prefix=/netdata_install/usr --sysconfdir=/netdata_install/etc --localstatedir=/netdata_install/var --with-zlib --with-math --with-user=netdata CFLAGS=-O2"
|
||||
- docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" make dist
|
||||
- docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" ls -ltr ./netdata-$(git describe).tar.gz || ls -ltr ./netdata-$(cat packaging/version | tr -d '\n').tar.gz
|
||||
- .travis/run_install_with_dist_file.sh
|
||||
|
@ -291,21 +291,56 @@ jobs:
|
|||
|
||||
- stage: "Artifacts validation on bare OS, stable to current lifecycle checks"
|
||||
|
||||
# Ubuntu runs
|
||||
name: Run netdata lifecycle on Ubuntu 16.04 (xenial)
|
||||
script: sudo -E tests/updater_checks.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Ubuntu 16.04"
|
||||
|
||||
- name: Run netdata lifecycle, on Ubuntu 19.04 (Containerized)
|
||||
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "ubuntu:19.04" tests/updater_checks.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Ubuntu 19.04"
|
||||
|
||||
# Centos runs
|
||||
- name: Run netdata lifecycle on CentOS 7 (Containerized)
|
||||
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "centos:7" tests/updater_checks.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare CentOS 7"
|
||||
|
||||
# Debian runs
|
||||
- name: Run netdata lifecycle, on Debian 9 (Containerized)
|
||||
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "debian:stretch" tests/updater_checks.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Debian 9 (stretch)"
|
||||
|
||||
- name: Run netdata lifecycle, on Ubuntu 19.04 (Containerized)
|
||||
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "ubuntu:19.04" tests/updater_checks.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Ubuntu 19.04"
|
||||
# openSuSE runs
|
||||
- name: Run netdata lifecycle, on openSuSE 15.0
|
||||
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "opensuse/leap:15.0" tests/updater_checks.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare opensuse/leap:15.0"
|
||||
|
||||
- name: Run netdata lifecycle, on openSuSE 15.1
|
||||
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "opensuse/leap:15.1" tests/updater_checks.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare opensuse/leap:15.1"
|
||||
|
||||
- name: Run netdata lifecycle, on openSuSE Tumbleweed
|
||||
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "opensuse/tumbleweed:latest" tests/updater_checks.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare opensuse/tumbleweed:latest"
|
||||
|
||||
# Alpine runs
|
||||
- name: Run netdata lifecycle, on Alpine linux
|
||||
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "alpine" tests/updater_checks.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Alpine"
|
||||
|
||||
# Arch linux runs
|
||||
- name: Run netdata lifecycle, on ArchLinux
|
||||
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "archlinux/base:latest" tests/updater_checks.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare archlinux/base:latest"
|
||||
|
||||
# Fedora runs
|
||||
- name: Run netdata lifecycle, on Fedora 28
|
||||
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "fedora:28" tests/updater_checks.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Fedora 28"
|
||||
|
||||
- name: Run netdata lifecycle, on Fedora 29
|
||||
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "fedora:29" tests/updater_checks.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Fedora 29"
|
||||
|
||||
- name: Run netdata lifecycle, on Fedora 30 (Containerized)
|
||||
script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "fedora:30" tests/updater_checks.sh
|
||||
|
|
|
@ -25,7 +25,6 @@ DIRS="usr/sbin/netdata
|
|||
var/log/netdata"
|
||||
|
||||
setup() {
|
||||
|
||||
# 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 "")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env sh
|
||||
#
|
||||
# Wrapper script that installs the required dependencies
|
||||
# for the BATS script to run successfully
|
||||
|
@ -9,6 +9,22 @@
|
|||
#
|
||||
|
||||
echo "Syncing/updating repository.."
|
||||
|
||||
blind_arch_grep_install() {
|
||||
# There is a peculiar docker case with arch, where grep is not available
|
||||
# This method will have to be triggered blindly, to inject grep so that we can process
|
||||
# It starts to become a chicken-egg situation with all the distros..
|
||||
echo "* * Workaround hack * *"
|
||||
echo "Attempting blind install for archlinux case"
|
||||
|
||||
if command -v pacman > /dev/null 2>&1; then
|
||||
echo "Executing grep installation"
|
||||
pacman -Sy
|
||||
pacman --noconfirm --needed -S grep
|
||||
fi
|
||||
}
|
||||
blind_arch_grep_install || echo "Workaround failed, proceed as usual"
|
||||
|
||||
running_os="$(cat /etc/os-release |grep '^ID=' | cut -d'=' -f2 | sed -e 's/"//g')"
|
||||
|
||||
case "${running_os}" in
|
||||
|
@ -19,17 +35,44 @@ case "${running_os}" in
|
|||
|
||||
echo "Installing extra dependencies.."
|
||||
yum install -y epel-release
|
||||
yum install -y git bats curl
|
||||
yum install -y bats curl
|
||||
;;
|
||||
"debian"|"ubuntu")
|
||||
echo "Running ${running_os}, updating APT repository"
|
||||
apt-get update -y
|
||||
apt-get install -y git bats curl
|
||||
apt-get install -y bats curl
|
||||
;;
|
||||
"opensuse-leap"|"opensuse-tumbleweed")
|
||||
zypper update -y
|
||||
zypper install -y bats curl
|
||||
;;
|
||||
"arch")
|
||||
pacman -Sy
|
||||
pacman --noconfirm --needed -S bash-bats curl
|
||||
;;
|
||||
"alpine")
|
||||
apk update
|
||||
apk add bash curl bats
|
||||
;;
|
||||
*)
|
||||
echo "Running on ${running_os}, no repository preparation done"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Download and run depednency scriptlet, before anything else
|
||||
#
|
||||
deps_tool="/tmp/deps_tool.$$.sh"
|
||||
curl -Ss -o ${deps_tool} https://raw.githubusercontent.com/netdata/netdata-demo-site/master/install-required-packages.sh
|
||||
if [ -f "${deps_tool}" ]; then
|
||||
echo "Running dependency handling script.."
|
||||
chmod +x "${deps_tool}"
|
||||
${deps_tool} --non-interactive netdata
|
||||
rm -f "${deps_tool}"
|
||||
echo "Done!"
|
||||
else
|
||||
echo "Failed to fetch dependency script, aborting the test"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Running BATS file.."
|
||||
bats --tap tests/updater_checks.bats
|
||||
|
|
Loading…
Add table
Reference in a new issue