forked from docker-solr/docker-solr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate-stackbrew-library.sh
More file actions
executable file
·51 lines (42 loc) · 1.25 KB
/
generate-stackbrew-library.sh
File metadata and controls
executable file
·51 lines (42 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -e
declare -A aliases
aliases=(
[6.3]='6 latest'
[5.5]='5'
)
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
versions=( */ )
versions=( "${versions[@]%/}" )
url='git://github.com/docker-solr/docker-solr'
echo '# maintainer: Martijn Koster <mak-github@greenhills.co.uk> (@makuk66)'
echo '# maintainer: Shalin Mangar <shalin@apache.org> (@shalinmangar)'
for version in "${versions[@]}"; do
if [ ! -f "$version/Dockerfile" ]; then
continue
fi
commit="$(git log -1 --format='format:%H' -- "$version")"
fullVersion="$(grep -m1 'ENV SOLR_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
for variant in alpine; do
commit="$(git log -1 --format='format:%H' -- "$version/$variant")"
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