Skip to content

Commit 4dc1a9e

Browse files
authored
automation: support EOL bump automation (elastic#390)
1 parent 416eaea commit 4dc1a9e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.buildkite/bump-go-release-version.sh

+11
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ MAJOR_MINOR_VERSION=$(echo "$GO_RELEASE_VERSION" | sed -E -e "s#([0-9]+\.[0-9]+)
2323
GOLANG_DOWNLOAD_SHA256_ARM=$(curl -s -L https://golang.org/dl/\?mode\=json | jq -r ".[] | select( .version | contains(\"go${GO_RELEASE_VERSION}\")) | .files[] | select (.filename | contains(\"go${GO_RELEASE_VERSION}.linux-arm64.tar.gz\")) | .sha256")
2424
GOLANG_DOWNLOAD_SHA256_AMD=$(curl -s -L https://golang.org/dl/\?mode\=json | jq -r ".[] | select( .version | contains(\"go${GO_RELEASE_VERSION}\")) | .files[] | select (.filename | contains(\"go${GO_RELEASE_VERSION}.linux-amd64.tar.gz\")) | .sha256")
2525

26+
## As long as https://golang.org/dl/?mode=json supports only 2 major versions
27+
## and there is a new major release, then it's required to parse https://golang.org/dl
28+
## see https://github.com/elastic/golang-crossbuild/pull/389/commits/d0af04f97a2381630ea5e8da5a99f50cf27856a0
29+
if [ -z "$GOLANG_DOWNLOAD_SHA256_ARM" ] ; then
30+
GOLANG_DOWNLOAD_SHA256_ARM=$(curl -s -L https://golang.org/dl | grep go${GO_RELEASE_VERSION}.linux-arm64.tar.gz -A 5 | grep "<tt>" | sed 's#.*<tt>##g' | sed 's#</t.*##g')
31+
fi
32+
33+
if [ -z "$GOLANG_DOWNLOAD_SHA256_AMD" ] ; then
34+
GOLANG_DOWNLOAD_SHA256_ARM=$(curl -s -L https://golang.org/dl | grep go${GO_RELEASE_VERSION}.linux-amd64.tar.gz -A 5 | grep "<tt>" | sed 's#.*<tt>##g' | sed 's#</t.*##g')
35+
fi
36+
2637
echo "Update go version ${GO_RELEASE_VERSION}"
2738

2839
find "go" -type f -name Dockerfile.tmpl -print0 |

0 commit comments

Comments
 (0)