Skip to content

Commit

Permalink
Add very simple generate-stackbrew-library.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
tianon committed Aug 11, 2014
1 parent c0e9bc5 commit 6210848
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"

url='git://github.com/docker-library/wordpress'

echo '# maintainer: InfoSiftr <[email protected]> (@infosiftr)'

commit="$(git log -1 --format='format:%H' .)"
fullVersion="$(grep -m1 'ENV WORDPRESS_VERSION ' Dockerfile | cut -d' ' -f3)"

versionAliases=()
while [ "${fullVersion%.*}" != "$fullVersion" ]; do
versionAliases+=( $fullVersion )
fullVersion="${fullVersion%.*}"
done
versionAliases+=( $fullVersion latest )

echo
for va in "${versionAliases[@]}"; do
echo "$va: ${url}@${commit} $version"
done

0 comments on commit 6210848

Please sign in to comment.