#!/bin/bash # compose: no-hooks ## List upstream available versions in reverse chronological order ## ## These versions information will be the input for the version ## information usually used by the build process. ## ## A external query of upstream sources will be done. ## ## By default, limit should be 1 (the latest version) usage="$exname [-h|--help] [-l|--limit ]" version_limit=5 while [ "$1" ]; do case "$1" in "--help"|"-h") print_usage exit 0 ;; "--limit"|"-l") version_limit="$2" shift ;; *) err "Unexpected argument '$1'." exit 1 ;; esac shift done set -e DOCKER_IMAGE_NAME=rocketchat/rocket.chat docker-tags-fetch "$DOCKER_IMAGE_NAME" -l "20" -f "^[0-9]+\.[0-9]+\.[0-9]+$" | sort -rV | head -n "${version_limit}"