forked from 0k/0k-charms
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.
37 lines
943 B
37 lines
943 B
#!/bin/bash
|
|
|
|
## 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.
|
|
##
|
|
|
|
## This script is launched by ``charm upstream-versions`` and will receive these env variables
|
|
##
|
|
##
|
|
## VERSION_LIMIT ## limit number of version to read
|
|
##
|
|
##
|
|
## The script CWD will be the root of the charm directory
|
|
##
|
|
|
|
DOCKER_IMAGE_NAME=nextcloud
|
|
|
|
semver:normalize() {
|
|
local upstream_version="$1"
|
|
echo "$upstream_version"
|
|
}
|
|
|
|
|
|
upstream:list() {
|
|
local limit=${1:-5}
|
|
docker-tags-fetch "$DOCKER_IMAGE_NAME" -l "${limit}" -f "^[0-9]+\.[0-9]+\.[0-9]+-apache" |
|
|
sort -rV |
|
|
cut -f 1 -d "-"
|
|
}
|
|
|
|
|
|
while read -r "upstream_version"; do
|
|
printf "%s %s\n" "$(semver:normalize "${upstream_version}")" "$upstream_version"
|
|
done < <(upstream:list "${VERSION_LIMIT}")
|