2
0

release.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/bin/bash
  2. set -e
  3. # **** NB ****
  4. # This iscript is no longer used, but it is kept here for reference.
  5. #
  6. # Don't start a release if the tree is dirty
  7. #
  8. if [[ ! -z $(git status -s) ]]; then
  9. echo "Git tree is not clean, aborting release!"
  10. exit 1
  11. fi
  12. # Get version and branch (we only do stable for now)
  13. #
  14. V="$1"
  15. RELEASE="${2:-stable}"
  16. if [[ -z $V ]]; then
  17. echo "A version must be specified!"
  18. exit 1
  19. fi
  20. VERSION="${RELEASE}-${V}"
  21. echo "Releasing ${VERSION}"
  22. if git rev-parse "${VERSION}" >/dev/null 2>&1; then
  23. echo "Tag for such version already exists!"
  24. exit 1
  25. fi
  26. # Prepare changelog
  27. #
  28. LAST_VERSION=$(git describe --tags --abbrev=0)
  29. CHANGES=$(git log --oneline --no-decorate --no-merges ${LAST_VERSION}..HEAD --pretty=format:"%x2a%x20%h%x20%s")
  30. echo "Changelog:"
  31. echo "$CHANGES"
  32. # Tag Docker images and push them to DockerHub
  33. #
  34. JITSI_BUILD=${VERSION} JITSI_RELEASE=${RELEASE} make release
  35. # Changelog
  36. #
  37. echo -e "## ${VERSION}\n\nBased on ${RELEASE} release ${V}.\n\n${CHANGES}\n" > tmp
  38. cat CHANGELOG.md >> tmp
  39. mv tmp CHANGELOG.md
  40. # Set specific image tags in compose files
  41. #
  42. sed -i".bak" -e "s/unstable/${VERSION}/" *.yml
  43. # Commit all changes and tag the repo
  44. #
  45. git commit -a -m "release: ${VERSION}" -m "${CHANGES}"
  46. git tag -a "${VERSION}" -m "release" -m "${CHANGES}"
  47. # Revert back to "unstable" for development
  48. #
  49. sed -i".bak" -e "s/${VERSION}/unstable/" *.yml
  50. git commit -a -m "misc: working on unstable"
  51. # Push all changes and tags
  52. #
  53. git push
  54. git push --tags