@cryptotaxi247 / netdata-1 / commits / 74952493f

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

Paul Emm. Katsoulakis committed Jun 4, 2019 at 17:16 UTC 74952493fbe90abfde1ffd9d302a46c64406690c
3 files changed +50 -4
.travis.yml
+27
@@ -1,3 +1,4 @@
1 +dist: xenial
2 sudo: true
3 language: c
4 services:
@@ -29,6 +30,8 @@ stages:
30 - name: Code quality, linting, syntax, code style
31 - name: Build process
32 - name: Artifacts validation
33 +- name: Artifacts validation on bare OS, stable to current lifecycle checks
34 + if: branch = master AND (type = pull_request OR type = cron)
35
36 # Nightly operations
37 - name: Nightly operations
@@ -135,6 +138,30 @@ jobs:
138
139
140
141 + - stage: "Artifacts validation on bare OS, stable to current lifecycle checks"
142 +
143 + name: Run netdata lifecycle on Ubuntu 16.04 (xenial)
144 + script: sudo -E tests/updater_checks.sh
145 + after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Ubuntu 16.04"
146 +
147 + - name: Run netdata lifecycle on CentOS 7 (Containerized)
148 + script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "centos:7" tests/updater_checks.sh
149 + after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare CentOS 7"
150 +
151 + - name: Run netdata lifecycle, on Debian 9 (Containerized)
152 + script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "debian:stretch" tests/updater_checks.sh
153 + after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Debian 9 (stretch)"
154 +
155 + - name: Run netdata lifecycle, on Ubuntu 19.04 (Containerized)
156 + script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "ubuntu:19.04" tests/updater_checks.sh
157 + after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Ubuntu 19.04"
158 +
159 + - name: Run netdata lifecycle, on Fedora 30 (Containerized)
160 + script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "fedora:30" tests/updater_checks.sh
161 + after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Fedora 30"
162 +
163 +
164 +
165 - stage: Packaging for release
166
167 name: Generate changelog and TAG the release (only on special commit msg)
health/notifications/alarm-notify.sh.in
+1 -1
@@ -1790,7 +1790,7 @@ if [ "${NETDATA_REGISTRY_URL}" == "https://registry.my-netdata.io" ]; then
1790 NETDATA_REGISTRY_UNIQUE_ID="$(cat "@registrydir_POST@/netdata.public.unique.id")"
1791 fi
1792 fi
1793 - if [ ! -z "${NETDATA_REGISTRY_UNIQUE_ID}" ]; then
1793 + if [ -n "${NETDATA_REGISTRY_UNIQUE_ID}" ]; then
1794 GOTOCLOUD=1
1795 fi
1796 fi
tests/updater_checks.sh
+22 -3
@@ -8,9 +8,28 @@
8 # Author : Pavlos Emm. Katsoulakis <paul@netdata.cloud)
9 #
10
11 -echo "Installing extra dependencies.."
12 -yum install -y epel-release
13 -yum install -y git bats
11 +echo "Syncing/updating repository.."
12 +running_os="$(cat /etc/os-release |grep '^ID=' | cut -d'=' -f2 | sed -e 's/"//g')"
13 +
14 +case "${running_os}" in
15 +"centos"|"fedora")
16 + echo "Running on CentOS, updating YUM repository.."
17 + yum clean all
18 + yum update -y
19 +
20 + echo "Installing extra dependencies.."
21 + yum install -y epel-release
22 + yum install -y git bats curl
23 + ;;
24 +"debian"|"ubuntu")
25 + echo "Running ${running_os}, updating APT repository"
26 + apt-get update -y
27 + apt-get install -y git bats curl
28 + ;;
29 +*)
30 + echo "Running on ${running_os}, no repository preparation done"
31 + ;;
32 +esac
33
34 echo "Running BATS file.."
35 bats --tap tests/updater_checks.bats