Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ language: bash
services: docker

env:
- VERSION=1.9-rc VARIANT=
- VERSION=1.9-rc VARIANT=alpine
- VERSION=1.8 VARIANT=
- VERSION=1.9-rc VARIANT=stretch
- VERSION=1.9-rc VARIANT=alpine3.6
- VERSION=1.8 VARIANT=jessie
- VERSION=1.8 VARIANT=stretch
- VERSION=1.8 VARIANT=alpine
- VERSION=1.8 VARIANT=alpine3.6
- VERSION=1.7 VARIANT=
- VERSION=1.8 VARIANT=alpine3.5
- VERSION=1.7 VARIANT=wheezy
- VERSION=1.7 VARIANT=alpine
- VERSION=1.7 VARIANT=jessie
- VERSION=1.7 VARIANT=alpine3.6
- VERSION=1.7 VARIANT=alpine3.5
- VERSION=1.7 VARIANT=alpine3.4

install:
- git clone https://github.com/docker-library/official-images.git ~/official-images
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
54 changes: 34 additions & 20 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/bin/bash
set -eu

defaultDebianSuite='stretch'
declare -A debianSuite=(
[1.8]='jessie'
[1.7]='jessie'
)
defaultAlpineVersion='3.6'
declare -A alpineVersion=(
[1.7]='3.4'
[1.8]='3.5'
)

declare -A aliases=(
[1.8]='1 latest'
[1.9-rc]='rc'
Expand Down Expand Up @@ -58,13 +69,7 @@ join() {
for version in "${versions[@]}"; do
rcVersion="${version%-rc}"

commit="$(dirCommit "$version")"

fullVersion="$(git show "$commit":"$version/Dockerfile" | awk '$1 == "ENV" && $2 == "GOLANG_VERSION" { print $3; exit }')"
[[ "$fullVersion" == *.*[^0-9]* ]] || fullVersion+='.0'

versionAliases=(
$fullVersion
$version
)
if [ "$version" != "$rcVersion" ]; then
Expand All @@ -76,32 +81,41 @@ for version in "${versions[@]}"; do
${aliases[$version]:-}
)

versionArches="$(variantArches "$version" '')"

echo
cat <<-EOE
Tags: $(join ', ' "${versionAliases[@]}")
Architectures: $(join ', ' $versionArches)
GitCommit: $commit
Directory: $version
EOE

for v in \
onbuild wheezy stretch alpine alpine3.6 alpine3.5 \
stretch jessie wheezy alpine3.6 alpine3.5 alpine3.4 onbuild \
windows/windowsservercore windows/nanoserver \
; do
dir="$version/$v"
variant="$(basename "$v")"

[ -f "$dir/Dockerfile" ] || continue

variant="$(basename "$v")"
versionSuite="${debianSuite[$version]:-$defaultDebianSuite}"

commit="$(dirCommit "$dir")"
fullVersion="$(git show "$commit":"$dir/Dockerfile" | awk '$1 == "ENV" && $2 == "GOLANG_VERSION" { print $3; exit }')"

variantAliases=( "${versionAliases[@]/%/-$variant}" )
if [ -z "$fullVersion" ]; then
# for onbuild, since it does not contain GOLANG_VERSION
suiteCommit="$(dirCommit "$version/$versionSuite")"
fullVersion="$(git show "$suiteCommit":"$version/$versionSuite/Dockerfile" | awk '$1 == "ENV" && $2 == "GOLANG_VERSION" { print $3; exit }')"
fi

[[ "$fullVersion" == *.*[^0-9]* ]] || fullVersion+='.0'

baseAliases=( $fullVersion "${versionAliases[@]}" )
variantAliases=( "${baseAliases[@]/%/-$variant}" )
variantAliases=( "${variantAliases[@]//latest-/}" )

if [ "$variant" = "$versionSuite" ]; then
variantAliases+=( "${baseAliases[@]}" )
elif [ "${variant#alpine}" = "${alpineVersion[$version]:-$defaultAlpineVersion}" ]; then
variantAliases+=( "${baseAliases[@]/%/-alpine}" )
variantAliases=( "${variantAliases[@]//latest-/}" )
fi

case "$v" in
onbuild) variantArches="$versionArches" ;;
onbuild) variantArches="$(variantArches "$version" "$versionSuite" )";;
alpine*) variantArches="$(parentArches "$version" "$v")" ;;
windows/*) variantArches='windows-amd64' ;;
*) variantArches="$(variantArches "$version" "$v")" ;;
Expand Down
18 changes: 3 additions & 15 deletions update.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
#!/bin/bash
set -Eeuo pipefail

defaultDebianSuite='stretch'
declare -A debianSuite=(
[1.8]='jessie'
[1.7]='jessie'
)
defaultAlpineVersion='3.6'
declare -A alpineVersion=(
[1.7]='3.4'
[1.8]='3.5'
)

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

source '.architectures-lib'
Expand Down Expand Up @@ -94,10 +83,9 @@ for version in "${versions[@]}"; do

windowsSha256="$(curl -fsSL "https://storage.googleapis.com/golang/go${fullVersion}.windows-amd64.zip.sha256")"

for variant in alpine3.5 alpine3.6 alpine; do
for variant in alpine3.4 alpine3.5 alpine3.6; do
if [ -d "$version/$variant" ]; then
ver="${variant#alpine}"
ver="${ver:-${alpineVersion[$version]:-$defaultAlpineVersion}}"
sed -r \
-e 's!%%VERSION%%!'"$fullVersion"'!g' \
-e 's!%%ALPINE-VERSION%%!'"$ver"'!g' \
Expand All @@ -107,11 +95,11 @@ for version in "${versions[@]}"; do
travisEnv='\n - VERSION='"$version VARIANT=$variant$travisEnv"
fi
done
for variant in stretch wheezy ''; do
for variant in stretch jessie wheezy; do
if [ -d "$version/$variant" ]; then
sed -r \
-e 's!%%VERSION%%!'"$fullVersion"'!g' \
-e 's!%%DEBIAN-SUITE%%!'"${variant:-${debianSuite[$version]:-$defaultDebianSuite}}"'!g' \
-e 's!%%DEBIAN-SUITE%%!'"$variant"'!g' \
-e 's!%%ARCH-CASE%%!'"$(sed_escape_rhs "$linuxArchCase")"'!g' \
Dockerfile-debian.template > "$version/$variant/Dockerfile"
cp go-wrapper "$version/$variant/"
Expand Down