mirror of
https://github.com/danog/php.git
synced 2024-11-26 20:04:58 +01:00
Add stackbrew generator
This commit is contained in:
parent
f9483c93a9
commit
4c98e81721
42
generate-stackbrew-library.sh
Executable file
42
generate-stackbrew-library.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
declare -A aliases
|
||||
aliases=(
|
||||
[5.5]='5 latest'
|
||||
)
|
||||
|
||||
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
|
||||
|
||||
versions=( */ )
|
||||
versions=( "${versions[@]%/}" )
|
||||
url='git://github.com/docker-library/php'
|
||||
|
||||
echo '# maintainer: InfoSiftr <github@infosiftr.com> (@infosiftr)'
|
||||
|
||||
for version in "${versions[@]}"; do
|
||||
commit="$(git log -1 --format='format:%H' "$version")"
|
||||
fullVersion="$(grep -m1 'ENV PHP_VERSION ' "$version/Dockerfile" | cut -d' ' -f3)"
|
||||
versionAliases=( $fullVersion $version ${aliases[$version]} )
|
||||
|
||||
echo
|
||||
for va in "${versionAliases[@]}"; do
|
||||
if [ "$va" != 'latest' ]; then
|
||||
va="$va-cli"
|
||||
fi
|
||||
echo "$va: ${url}@${commit} $version"
|
||||
done
|
||||
|
||||
for variant in apache; 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
|
Loading…
Reference in New Issue
Block a user