Skip to content

Commit

Permalink
automation: support EOL bump automation (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Feb 15, 2024
1 parent 416eaea commit 4dc1a9e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .buildkite/bump-go-release-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ MAJOR_MINOR_VERSION=$(echo "$GO_RELEASE_VERSION" | sed -E -e "s#([0-9]+\.[0-9]+)
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")
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")

## As long as https://golang.org/dl/?mode=json supports only 2 major versions
## and there is a new major release, then it's required to parse https://golang.org/dl
## see https://github.com/elastic/golang-crossbuild/pull/389/commits/d0af04f97a2381630ea5e8da5a99f50cf27856a0
if [ -z "$GOLANG_DOWNLOAD_SHA256_ARM" ] ; then
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')
fi

if [ -z "$GOLANG_DOWNLOAD_SHA256_AMD" ] ; then
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')
fi

echo "Update go version ${GO_RELEASE_VERSION}"

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

0 comments on commit 4dc1a9e

Please sign in to comment.