Skip to content

Commit f4a3691

Browse files
committed
Adjust "rc" consumption to be explicit, as in other repositories
1 parent 8de30e2 commit f4a3691

File tree

11 files changed

+23
-5
lines changed

11 files changed

+23
-5
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ language: bash
22
services: docker
33

44
env:
5-
- VERSION=1.8 VARIANT=
6-
- VERSION=1.8 VARIANT=alpine
5+
- VERSION=1.8-rc VARIANT=
6+
- VERSION=1.8-rc VARIANT=alpine
77
- VERSION=1.7 VARIANT=
88
- VERSION=1.7 VARIANT=wheezy
99
- VERSION=1.7 VARIANT=alpine
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

1.8/onbuild/Dockerfile renamed to 1.8-rc/onbuild/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.8
1+
FROM golang:1.8-rc
22

33
RUN mkdir -p /go/src/app
44
WORKDIR /go/src/app

generate-stackbrew-library.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set -eu
33

44
declare -A aliases=(
55
[1.7]='1 latest'
6+
[1.8-rc]='rc'
67
)
78

89
self="$(basename "$BASH_SOURCE")"
@@ -50,6 +51,8 @@ join() {
5051
}
5152

5253
for version in "${versions[@]}"; do
54+
rcVersion="${version%-rc}"
55+
5356
commit="$(dirCommit "$version")"
5457

5558
fullVersion="$(git show "$commit":"$version/Dockerfile" | awk '$1 == "ENV" && $2 == "GOLANG_VERSION" { print $3; exit }')"
@@ -58,6 +61,13 @@ for version in "${versions[@]}"; do
5861
versionAliases=(
5962
$fullVersion
6063
$version
64+
)
65+
if [ "$version" != "$rcVersion" ]; then
66+
versionAliases+=(
67+
$rcVersion
68+
)
69+
fi
70+
versionAliases+=(
6171
${aliases[$version]:-}
6272
)
6373

update.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@ versions=( "${versions[@]%/}" )
1313
travisEnv=
1414
googleSource="$(curl -fsSL 'https://golang.org/dl/')"
1515
for version in "${versions[@]}"; do
16+
rcVersion="${version%-rc}"
17+
rcGrepV='-v'
18+
if [ "$rcVersion" != "$version" ]; then
19+
rcGrepV=
20+
fi
21+
rcGrepV+=' -E'
22+
rcGrepExpr='rc'
23+
1624
# First check for full version from GitHub as a canonical source
17-
fullVersion="$(curl -fsSL "https://raw.githubusercontent.com/golang/go/release-branch.go$version/VERSION" 2>/dev/null || true)"
25+
fullVersion="$(curl -fsSL "https://raw.githubusercontent.com/golang/go/release-branch.go$rcVersion/VERSION" 2>/dev/null | grep $rcGrepV -- "$rcGrepExpr" || true)"
1826
if [ -z "$fullVersion" ]; then
1927
echo >&2 "warning: cannot find version from GitHub for $version, scraping golang download page"
20-
fullVersion="$(echo $googleSource | grep -Po '">go'"$version"'.*?\.src\.tar\.gz</a>' | sed -r 's!.*go([^"/<]+)\.src\.tar\.gz.*!\1!' | sort -V | tail -1)"
28+
fullVersion="$(echo $googleSource | grep -Po '">go'"$rcVersion"'.*?\.src\.tar\.gz</a>' | sed -r 's!.*go([^"/<]+)\.src\.tar\.gz.*!\1!' | grep $rcGrepV -- "$rcGrepExpr" | sort -V | tail -1)"
2129
fi
2230
if [ -z "$fullVersion" ]; then
2331
echo >&2 "warning: cannot find full version for $version"

0 commit comments

Comments
 (0)