From 6210848ab3f761d5f3bafbb9cad4495807d26a0a Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 11 Aug 2014 16:20:20 -0600 Subject: [PATCH] Add very simple generate-stackbrew-library.sh --- generate-stackbrew-library.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 generate-stackbrew-library.sh diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh new file mode 100755 index 000000000000..97784f80bd2a --- /dev/null +++ b/generate-stackbrew-library.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" + +url='git://github.com/docker-library/wordpress' + +echo '# maintainer: InfoSiftr (@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