summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Emm. Katsoulakis <34388743+paulkatsoulakis@users.noreply.github.com>2019-06-04 17:16:07 +0300
committerGitHub <noreply@github.com>2019-06-04 17:16:07 +0300
commit74952493fbe90abfde1ffd9d302a46c64406690c (patch)
tree0bcd73b3aea4594b39381c7576490dca08f048df /tests
parent6240d638d5bc8867009bbd957678842693fe25c0 (diff)
netdata/packaging/ci: Add lifecycle checks to bare operating system installations (#6209)
* Introduce more tests on bare OS, to block possible dependency issues in the code * Move bare OS tests on their own stage, to get direct visibility upon possible dependency issues * Limit bare OS runs on pull requests and cron, to avoid messing with people's development runs. We can catch dependency or peculiar build issues during PRs * Rushed it, we now running on different distros, adjust the repository clean up * Centos7 adds quotes on the ID, lets strip them out * Still, you need to add the required packages for testing on debian/ubuntu * curl also required * We 'll be using 16.04 as default distro, not 14.04 * Add an irrelevant shellcheck error, probably raised depending on bash version as we didnt have it with 14.04 * The job needs to run as root, add sudo
Diffstat (limited to 'tests')
-rwxr-xr-xtests/updater_checks.sh25
1 files changed, 22 insertions, 3 deletions
diff --git a/tests/updater_checks.sh b/tests/updater_checks.sh
index dce136853f..6d5aeabf31 100755
--- a/tests/updater_checks.sh
+++ b/tests/updater_checks.sh
@@ -8,9 +8,28 @@
# Author : Pavlos Emm. Katsoulakis <paul@netdata.cloud)
#
-echo "Installing extra dependencies.."
-yum install -y epel-release
-yum install -y git bats
+echo "Syncing/updating repository.."
+running_os="$(cat /etc/os-release |grep '^ID=' | cut -d'=' -f2 | sed -e 's/"//g')"
+
+case "${running_os}" in
+"centos"|"fedora")
+ echo "Running on CentOS, updating YUM repository.."
+ yum clean all
+ yum update -y
+
+ echo "Installing extra dependencies.."
+ yum install -y epel-release
+ yum install -y git bats curl
+ ;;
+"debian"|"ubuntu")
+ echo "Running ${running_os}, updating APT repository"
+ apt-get update -y
+ apt-get install -y git bats curl
+ ;;
+*)
+ echo "Running on ${running_os}, no repository preparation done"
+ ;;
+esac
echo "Running BATS file.."
bats --tap tests/updater_checks.bats