Tools for working in the OpenStack Oslo community.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

list_latest_releases.sh 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  4. # not use this file except in compliance with the License. You may obtain
  5. # a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  11. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  12. # License for the specific language governing permissions and limitations
  13. # under the License.
  14. #
  15. # Show the latest tags for all Oslo projects as an approximation for
  16. # reporting on which releases exist.
  17. bindir=$(cd $(dirname $0) && pwd)
  18. repodir=$(cd $bindir/../../.. && pwd)
  19. # Make sure no pager is configured so the output is not blocked
  20. export PAGER=
  21. if [ -z "$*" ]
  22. then
  23. libs=$($bindir/list_oslo_projects.py | egrep -v -e '(oslo.version|cookiecutter|incubator)')
  24. else
  25. libs="$*"
  26. fi
  27. function get_last_tag {
  28. git for-each-ref --sort=taggerdate --format '%(refname)' refs/tags \
  29. | sed -e 's|refs/tags/||' \
  30. | ${bindir}/highest_semver.py
  31. }
  32. function list_versions {
  33. # Show the tag for each library
  34. for lib in $*
  35. do
  36. the_date=""
  37. cd $repodir/$lib
  38. highest_tag=$(get_last_tag)
  39. if [ -z "$highest_tag" ]
  40. then
  41. the_date="0000-00-00 00:00:00 +0000"
  42. highest_tag="UNRELEASED"
  43. else
  44. the_date=$(git log -q --format='format:%ci' -n 1 $highest_tag)
  45. fi
  46. echo $the_date $lib $highest_tag
  47. done
  48. }
  49. list_versions $libs | sort -nr