mirror of
https://github.com/EpicMorg/docker-scripts.git
synced 2024-12-27 07:05:41 +03:00
28 lines
659 B
Bash
28 lines
659 B
Bash
|
#!/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
|