Skip to content

Commit

Permalink
Merge pull request #6 from tianon/generate-stackbrew-library
Browse files Browse the repository at this point in the history
Add generate-stackbrew-library.sh script for updating library/mono in an automated way
  • Loading branch information
directhex committed Jan 15, 2015
2 parents bec8f72 + 28ff7e2 commit 5856f94
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -e

declare -A aliases
aliases=(
[3.12.0]='3.12 3 latest'
[3.10.0]='3.10'
[3.8.0]='3.8'
)

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

versions=( */ )
versions=( "${versions[@]%/}" )
url='git://github.com/mono/docker'

echo '# maintainer: Jo Shields <[email protected]> (@directhex)'

for version in "${versions[@]}"; do
commit="$(git log -1 --format='format:%H' -- "$version")"
versionAliases=( $version ${aliases[$version]} )

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

for variant in onbuild; 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

0 comments on commit 5856f94

Please sign in to comment.