create_artifacts.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. # shellcheck disable=SC2230
  3. set -e
  4. if [ ! -f .gitignore ]; then
  5. echo "Run as ./travis/$(basename "$0") from top level directory of git repository"
  6. exit 1
  7. fi
  8. if [ ! "${TRAVIS_REPO_SLUG}" == "netdata/netdata" ]; then
  9. echo "Beta mode on ${TRAVIS_REPO_SLUG}, not running anything here"
  10. exit 0
  11. fi;
  12. echo "--- Initialize git configuration ---"
  13. git checkout master
  14. git pull
  15. # Everything from this directory will be uploaded to GCS
  16. mkdir -p artifacts
  17. BASENAME="netdata-$(git describe)"
  18. # Make sure stdout is in blocking mode. If we don't, then conda create will barf during downloads.
  19. # See https://github.com/travis-ci/travis-ci/issues/4704#issuecomment-348435959 for details.
  20. python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
  21. echo "--- Create tarball ---"
  22. autoreconf -ivf
  23. ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --with-zlib --with-math --with-user=netdata CFLAGS=-O2
  24. make dist
  25. mv "${BASENAME}.tar.gz" artifacts/
  26. echo "--- Create self-extractor ---"
  27. ./packaging/makeself/build-x86_64-static.sh
  28. # Needed for GCS
  29. echo "--- Copy artifacts to separate directory ---"
  30. #shellcheck disable=SC2164
  31. cp packaging/version artifacts/latest-version.txt
  32. cd artifacts
  33. ln -s "${BASENAME}.tar.gz" netdata-latest.tar.gz
  34. ln -s "${BASENAME}.gz.run" netdata-latest.gz.run
  35. sha256sum -b ./* >"sha256sums.txt"
  36. echo "checksums:"
  37. cat sha256sums.txt