run_install_with_dist_file.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/env bash
  2. #
  3. # This script is evaluating netdata installation with the source from make dist
  4. #
  5. # Copyright: SPDX-License-Identifier: GPL-3.0-or-later
  6. #
  7. # Author : Pavlos Emm. Katsoulakis <paul@netdata.cloud)
  8. set -e
  9. if [ $# -ne 1 ]; then
  10. printf >&2 "Usage: %s <dist_file>\n" "$(basename "$0")"
  11. exit 1
  12. fi
  13. distfile="${1}"
  14. shift
  15. printf >&2 "Opening dist archive %s ... " "${distfile}"
  16. tar -xovf "${distfile}"
  17. distdir="$(echo "${distfile}" | rev | cut -d. -f3- | rev)"
  18. cp -a packaging/installer/install-required-packages.sh "${distdir}/install-required-packages.sh"
  19. if [ ! -d "${distdir}" ]; then
  20. printf >&2 "ERROR: %s is not a directory" "${distdir}"
  21. exit 2
  22. fi
  23. printf >&2 "Entering %s and starting docker run ..." "${distdir}"
  24. pushd "${distdir}" || exit 1
  25. docker run \
  26. -e DISABLE_TELEMETRY=1 \
  27. -v "${PWD}:/netdata" \
  28. -w /netdata \
  29. "ubuntu:latest" \
  30. /bin/bash -c "./install-required-packages.sh --dont-wait --non-interactive netdata && apt install wget && ./netdata-installer.sh --dont-wait --require-cloud --disable-telemetry --install /tmp --one-time-build && echo \"Validating netdata instance is running\" && wget -O - 'http://127.0.0.1:19999/api/v1/info' | grep version"
  31. popd || exit 1
  32. echo "All Done!"