diff options
-rwxr-xr-x | .github/scripts/run_install_with_dist_file.sh | 37 | ||||
-rw-r--r-- | .github/workflows/checks.yml | 30 | ||||
-rw-r--r-- | .travis.yml | 20 | ||||
-rwxr-xr-x | .travis/run_install_with_dist_file.sh | 48 |
4 files changed, 67 insertions, 68 deletions
diff --git a/.github/scripts/run_install_with_dist_file.sh b/.github/scripts/run_install_with_dist_file.sh new file mode 100755 index 0000000000..519693f4db --- /dev/null +++ b/.github/scripts/run_install_with_dist_file.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# +# This script is evaluating netdata installation with the source from make dist +# +# Copyright: SPDX-License-Identifier: GPL-3.0-or-later +# +# Author : Pavlos Emm. Katsoulakis <paul@netdata.cloud) + +set -e + +if [ $# -ne 1 ]; then + printf >&2 "Usage: %s <dist_file>\n" "$(basename "$0")" + exit 1 +fi + +distfile="${1}" +shift + +printf >&2 "Opening dist archive %s ... " "${distfile}" +tar -xovf "${distfile}" +distdir="$(echo "${distfile}" | cut -d. -f1,2,3)" +if [ ! -d "${distdir}" ]; then + printf >&2 "ERROR: %s is not a directory" "${distdir}" + exit 2 +fi + +printf >&2 "Entering %s and starting docker run ..." "${distdir}" + +pushd "${distdir}" || exit 1 +docker run \ + -v "${PWD}:/netdata" \ + -w /netdata \ + "netdata/os-test:centos7" \ + /bin/bash -c "./netdata-installer.sh --dont-wait --install /tmp && echo \"Validating netdata instance is running\" && wget -O - 'http://127.0.0.1:19999/api/v1/info' | grep version" +popd || exit 1 + +echo "All Done!" diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6e379d12e3..1c2455e049 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -37,3 +37,33 @@ jobs: - name: Compare generated Dashboard vs. Backed up Dashboard run: | diff -sNrdu /tmp/dashboard.js web/gui/dashboard.js + dist-checks: + name: Dist + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Prepare environment + run: | + ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata-all + sudo apt-get install -y libjson-c-dev libipmimonitoring-dev libcups2-dev libsnappy-dev \ + libprotobuf-dev libprotoc-dev libssl-dev protobuf-compiler \ + libnetfilter-acct-dev + - name: Configure + run: | + autoreconf -ivf + ./configure \ + --with-zlib \ + --with-math \ + --with-user=netdata \ + CFLAGS=-O2 + - name: Make dist + run: | + make dist + - name: Verify & Set distfile + run: | + ls -lah netdata-*.tar.gz + echo "::set-env name=DISTFILE::$(ls netdata-*.tar.gz)" + - name: Run run_install_with_dist_file.sh + run: | + ./.github/scripts/run_install_with_dist_file.sh "${DISTFILE}" diff --git a/.travis.yml b/.travis.yml index defcdb3d57..8d590eb0af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -107,26 +107,6 @@ jobs: env: DEVEL="true" after_failure: post_message "TRAVIS_MESSAGE" "Docker build process failed" - - name: Run 'make dist' validation - before_script: mkdir /tmp/netdata-makedist-test - script: - - echo "GIT Branch:" && git branch - - echo "Last commit:" && git log -1 - - echo "GIT Describe:" && git describe - - 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" /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 - - docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" make distclean - git: - depth: false - after_script: rm -rf /tmp/netdata-makedist-test - after_failure: post_message "TRAVIS_MESSAGE" "'make dist' failed" - - - stage: Artifacts validation name: Unit Testing script: diff --git a/.travis/run_install_with_dist_file.sh b/.travis/run_install_with_dist_file.sh deleted file mode 100755 index ccad627cc2..0000000000 --- a/.travis/run_install_with_dist_file.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -# -# This script is evaluating netdata installation with the source from make dist -# -# Copyright: SPDX-License-Identifier: GPL-3.0-or-later -# -# Author : Pavlos Emm. Katsoulakis <paul@netdata.cloud) -# -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 .travis/$(basename "$0") from top level directory of netdata git repository" - echo "Changelog generation process aborted" - exit 1 -fi - -echo "Initiating dist archive contents validation" -DIST_FILE_FROM_GIT="netdata-$(git describe).tar.gz" -DIST_FILE_FROM_FILE="netdata-$(tr -d '\n' < packaging/version).tar.bgz" -if [ -f ${DIST_FILE_FROM_GIT} ]; then - DIST_FILE="${DIST_FILE_FROM_GIT}" -elif [ -f ${DIST_FILE_FROM_FILE} ]; then - DIST_FILE="${DIST_FILE_FROM_FILE}" -else - echo "I could not find netdata distfile. Nor ${DIST_FILE_FROM_GIT} or ${DIST_FILE_FROM_FILE} exist" - exit 1 -fi - -echo "Opening dist archive ${DIST_FILE}" -tar -xovf "${DIST_FILE}" -NETDATA_DIST_FOLDER=$(echo ${DIST_FILE} | cut -d. -f1,2,3) -if [ ! -d ${NETDATA_DIST_FOLDER} ]; then - echo "I could not locate folder ${NETDATA_DIST_FOLDER}, something went wrong failing the test" - exit 1 -fi - -echo "Entering ${NETDATA_DIST_FOLDER} and starting docker compilation" -cd ${NETDATA_DIST_FOLDER} -docker run -it -v "${PWD}:/code:rw" -w /code "netdata/os-test:centos7" /bin/bash -c "./netdata-installer.sh --dont-wait --install /tmp && echo \"Validating netdata instance is running\" && wget -O'-' 'http://127.0.0.1:19999/api/v1/info' | grep version" - -echo "Installation completed with no errors! Removing temporary folders" - -# TODO: Travis give me a permission denied on some files here, i made it a soft error until i figure out what is wrong -cd - -rm -rf ${NETDATA_DIST_FOLDER} || echo "I could not remove temporary directory, make sure you delete ${NETDATA_DIST_FOLDER} by yourself if this wasn't run over ephemeral storage" |