2014-08-14 14:58:13 -04:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
declare -A aliases
|
|
|
|
aliases=(
|
2014-12-26 12:35:55 -05:00
|
|
|
[2.2]='2 latest'
|
2014-08-14 14:58:13 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
|
|
|
|
|
|
|
|
versions=( */ )
|
|
|
|
versions=( "${versions[@]%/}" )
|
|
|
|
url='git://github.com/docker-library/ruby'
|
|
|
|
|
|
|
|
echo '# maintainer: InfoSiftr <github@infosiftr.com> (@infosiftr)'
|
|
|
|
|
|
|
|
for version in "${versions[@]}"; do
|
2015-08-11 18:12:55 -04:00
|
|
|
commit="$(cd "$version" && git log -1 --format='format:%H' -- Dockerfile $(awk 'toupper($1) == "COPY" { for (i = 2; i < NF; i++) { print $i } }' Dockerfile))"
|
2014-08-14 14:58:13 -04:00
|
|
|
fullVersion="$(grep -m1 'ENV RUBY_VERSION ' "$version/Dockerfile" | cut -d' ' -f3)"
|
|
|
|
|
|
|
|
versionAliases=()
|
|
|
|
while [ "$fullVersion" != "$version" -a "${fullVersion%[.-]*}" != "$fullVersion" ]; do
|
|
|
|
versionAliases+=( $fullVersion )
|
|
|
|
fullVersion="${fullVersion%[.-]*}"
|
|
|
|
done
|
|
|
|
versionAliases+=( $version ${aliases[$version]} )
|
|
|
|
|
|
|
|
echo
|
|
|
|
for va in "${versionAliases[@]}"; do
|
|
|
|
echo "$va: ${url}@${commit} $version"
|
|
|
|
done
|
|
|
|
|
2015-07-23 15:42:21 -04:00
|
|
|
for variant in onbuild slim; do
|
2015-08-11 18:12:55 -04:00
|
|
|
commit="$(cd "$version/$variant" && git log -1 --format='format:%H' -- Dockerfile $(awk 'toupper($1) == "COPY" { for (i = 2; i < NF; i++) { print $i } }' Dockerfile))"
|
2014-08-14 14:58:13 -04:00
|
|
|
echo
|
|
|
|
for va in "${versionAliases[@]}"; do
|
|
|
|
if [ "$va" = 'latest' ]; then
|
|
|
|
va="$variant"
|
|
|
|
else
|
|
|
|
va="$va-$variant"
|
|
|
|
fi
|
|
|
|
echo "$va: ${url}@${commit} $version/$variant"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
done
|