From ecccc4329cff94555fa6bbf500f23163d057caa0 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Wed, 5 Apr 2023 10:03:58 -0700 Subject: [PATCH] [1.1] ci/cirrus: use Go 1.19.x not 1.19 [XXX 1.1 note: the above subject and the rest of the commit message is the original description from the cherry-picked commit which talks about 1.19 -- while in fact it is now 1.20.] This variable is used in curl to download a go release, so we are using the initial Go 1.19 release in Cirrus CI, not the latest Go 1.19.x release. From the CI perspective, it makes more sense to use the latest release. Add some jq magic to extract the latest minor release information from the download page, and use it. This brings Cirrus CI jobs logic in line with all the others (GHA, Dockerfile), where by 1.20 we actually mean "latest 1.20.x". Signed-off-by: Kir Kolyshkin (cherry picked from commit 873d7bb3a3a135398228f6ad48f527cba69393d9) Signed-off-by: Kir Kolyshkin --- .cirrus.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 48252761b..8100ece13 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -130,7 +130,10 @@ task: # Use --whatprovides since some packages are renamed. rpm -q --whatprovides $RPMS # install Go - curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local + PREFIX="https://go.dev/dl/" + # Find out the latest minor release URL. + eval $(curl -fsSL "${PREFIX}?mode=json" | jq -r --arg Ver "$GO_VERSION" '.[] | select(.version | startswith("go\($Ver)")) | .files[] | select(.os == "linux" and .arch == "amd64" and .kind == "archive") | "filename=\"" + .filename + "\""') + curl -fsSL "$PREFIX$filename" | tar Cxz /usr/local # install bats cd /tmp git clone https://github.com/bats-core/bats-core