From 5b0a2eff6cc39a2ba550b2aace858bb34deca310 Mon Sep 17 00:00:00 2001 From: Shawn Reuland Date: Wed, 1 Nov 2023 12:16:42 -0700 Subject: [PATCH] fixed dependecnies for verify-range to to get go version dynmaically from go.mod --- services/horizon/docker/verify-range/dependencies | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/services/horizon/docker/verify-range/dependencies b/services/horizon/docker/verify-range/dependencies index fa622f9d2e..910ee9cf21 100644 --- a/services/horizon/docker/verify-range/dependencies +++ b/services/horizon/docker/verify-range/dependencies @@ -11,13 +11,17 @@ echo "deb https://apt.stellar.org $(lsb_release -cs) stable" | sudo tee -a /etc/ apt-get update apt-get install -y stellar-core=${STELLAR_CORE_VERSION} -wget -q https://dl.google.com/go/go1.18.linux-amd64.tar.gz -tar -C /usr/local -xzf go1.18.linux-amd64.tar.gz - git clone https://github.com/stellar/go.git stellar-go cd stellar-go + # By default "git fetch" only fetches refs/ # Below ensures we also fetch PR refs git config --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pull/*" git fetch --force --quiet origin + +GO_VERSION=$(sed -En 's/^go[[:space:]]+([[:digit:].]+)$/\1/p' go.mod) +wget -q https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz +tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz +rm -f go${GO_VERSION}.linux-amd64.tar.gz + /usr/local/go/bin/go build -v ./services/horizon