2014-08-14 14:58:13 -04:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
declare -A aliases
|
|
|
|
aliases=(
|
2014-08-14 20:11:25 -04:00
|
|
|
[2.1]='2 latest'
|
|
|
|
[1.9]='1'
|
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
|
2014-11-06 20:48:55 -05:00
|
|
|
commit="$(git log -1 --format='format:%H' -- "$version")"
|
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
|
|
|
|
|
2014-12-14 18:16:36 -05:00
|
|
|
for variant in onbuild wheezy; do
|
2014-11-26 00:04:48 -05:00
|
|
|
commit="$(git log -1 --format='format:%H' -- "$version/$variant")"
|
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
|