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.

41 lines
910 B

  1. #!/bin/bash
  2. # compose: no-hooks
  3. ## List upstream available versions in reverse chronological order
  4. ##
  5. ## These versions information will be the input for the version
  6. ## information usually used by the build process.
  7. ##
  8. ## A external query of upstream sources will be done.
  9. ##
  10. ## By default, limit should be 1 (the latest version)
  11. usage="$exname [-h|--help] [-l|--limit <limit>]"
  12. version_limit=5
  13. while [ "$1" ]; do
  14. case "$1" in
  15. "--help"|"-h")
  16. print_usage
  17. exit 0
  18. ;;
  19. "--limit"|"-l")
  20. version_limit="$2"
  21. shift
  22. ;;
  23. *)
  24. err "Unexpected argument '$1'."
  25. exit 1
  26. ;;
  27. esac
  28. shift
  29. done
  30. set -e
  31. DOCKER_IMAGE_NAME=vaultwarden/server
  32. docker-tags-fetch "$DOCKER_IMAGE_NAME" -l "20" -f "^[0-9]+\.[0-9]+\.[0-9]+-alpine" |
  33. sort -rV |
  34. cut -f 1 -d "-" |
  35. head -n "$version_limit"