install.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/sh
  2. install_debian_like() {
  3. # This is needed to ensure package installs don't prompt for any user input.
  4. export DEBIAN_FRONTEND=noninteractive
  5. apt-get update
  6. # Install NetData
  7. apt-get install -y "/artifacts/netdata_${VERSION}_${ARCH}.deb"
  8. # Install testing tools
  9. apt-get install -y --no-install-recommends \
  10. curl netcat jq
  11. }
  12. install_fedora_like() {
  13. # Using a glob pattern here because I can't reliably determine what the
  14. # resulting package name will be (TODO: There must be a better way!)
  15. PKGMGR="$( (command -v dnf > /dev/null && echo "dnf") || echo "yum")"
  16. # Install NetData
  17. "$PKGMGR" install -y /artifacts/netdata-"${VERSION}"-*.rpm
  18. # Install testing tools
  19. "$PKGMGR" install -y curl nc jq
  20. }
  21. install_suse_like() {
  22. # Using a glob pattern here because I can't reliably determine what the
  23. # resulting package name will be (TODO: There must be a better way!)
  24. # Install NetData
  25. # FIXME: Allow unsigned packages (for now) #7773
  26. zypper install -y --allow-unsigned-rpm \
  27. /artifacts/netdata-"${VERSION}"-*.rpm
  28. # Install testing tools
  29. zypper install -y --no-recommends \
  30. curl netcat jq
  31. }
  32. case "${DISTRO}" in
  33. debian | ubuntu)
  34. install_debian_like
  35. ;;
  36. fedora | centos)
  37. install_fedora_like
  38. ;;
  39. opensuse)
  40. install_suse_like
  41. ;;
  42. *)
  43. printf "ERROR: unspported distro: %s_%s\n" "${DISTRO}" "${DISTRO_VERSION}"
  44. exit 1
  45. ;;
  46. esac