docker-scripts/linux/postgres/generate-stackbrew-library.sh

28 lines
659 B
Bash
Raw Normal View History

2020-02-06 16:16:24 +03:00
#!/bin/bash
set -e
declare -A aliases
aliases=(
[9.3]='9 latest'
[8.4]='8'
)
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
versions=( */ )
versions=( "${versions[@]%/}" )
url='git://github.com/docker-library/postgres'
echo '# maintainer: InfoSiftr <github@infosiftr.com> (@infosiftr)'
for version in "${versions[@]}"; do
commit="$(git log -1 --format='format:%H' "$version")"
fullVersion="$(grep -m1 'ENV PG_VERSION ' "$version/Dockerfile" | cut -d' ' -f3 | cut -d- -f1 | sed 's/~/-/g')"
versionAliases=( $fullVersion $version ${aliases[$version]} )
echo
for va in "${versionAliases[@]}"; do
echo "$va: ${url}@${commit} $version"
done
done