Skip to content

Commit f627096

Browse files
committed
Merge pull request postgres#7 from infosiftr/generate-stackbrew-library
Add script to generate "library/postgres" for stackbrew
2 parents c6484bf + 8e917a6 commit f627096

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

generate-stackbrew-library.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
set -e
3+
4+
declare -A aliases
5+
aliases=(
6+
[9.3]='latest 9'
7+
[8.4]='8'
8+
)
9+
10+
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
11+
12+
versions=( */ )
13+
versions=( "${versions[@]%/}" )
14+
commit="$(git log -1 --format='format:%H')"
15+
url='git://github.com/docker-library/postgres'
16+
17+
echo '# maintainer: InfoSiftr <github@infosiftr.com> (@infosiftr)'
18+
19+
for version in "${versions[@]}"; do
20+
fullVersion="$(grep -m1 'ENV PG_VERSION ' "$version/Dockerfile" | cut -d' ' -f3 | cut -d- -f1 | sed 's/~/-/g')"
21+
versionAliases=( ${aliases[$version]} $version $fullVersion )
22+
23+
echo
24+
for va in "${versionAliases[@]}"; do
25+
echo "$va: ${url}@${commit} $version"
26+
done
27+
done

0 commit comments

Comments
 (0)