create_changelog.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/env bash
  2. #
  3. # Copyright: SPDX-License-Identifier: GPL-3.0-or-later
  4. #
  5. # Author : Pavlos Emm. Katsoulakis (paul@netdata.cloud)
  6. set -e
  7. # If we are not in netdata git repo, at the top level directory, fail
  8. TOP_LEVEL=$(basename "$(git rev-parse --show-toplevel)")
  9. CWD=$(git rev-parse --show-cdup || echo "")
  10. if [ -n "$CWD" ] || [ ! "${TOP_LEVEL}" == "netdata" ]; then
  11. echo "Run as .travis/$(basename "$0") from top level directory of netdata git repository"
  12. echo "Changelog creation aborted"
  13. exit 1
  14. fi
  15. ORGANIZATION=$(echo "$TRAVIS_REPO_SLUG" | awk -F '/' '{print $1}')
  16. PROJECT=$(echo "$TRAVIS_REPO_SLUG" | awk -F '/' '{print $2}')
  17. GIT_MAIL=${GIT_MAIL:-"bot@netdata.cloud"}
  18. GIT_USER=${GIT_USER:-"netdatabot"}
  19. if [ -z ${GIT_TAG+x} ]; then
  20. OPTS=""
  21. else
  22. OPTS="--future-release ${GIT_TAG}"
  23. fi
  24. if [ ! "${TRAVIS_REPO_SLUG}" == "netdata/netdata" ]; then
  25. echo "Beta mode on ${TRAVIS_REPO_SLUG}, nothing else to do here"
  26. exit 0
  27. fi
  28. echo "--- Creating changelog ---"
  29. git checkout master
  30. git pull
  31. docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PWD}"
  32. docker run -it -v "$(pwd)":/project markmandel/github-changelog-generator:latest \
  33. --user "${ORGANIZATION}" \
  34. --project "${PROJECT}" \
  35. --token "${GITHUB_TOKEN}" \
  36. --since-tag "v1.10.0" \
  37. --unreleased-label "**Next release**" \
  38. --no-issues \
  39. --exclude-labels "stale,duplicate,question,invalid,wontfix,discussion,no changelog" \
  40. --max-issues 500 \
  41. --bug-labels IGNOREBUGS ${OPTS}