Added retry logic to all remote calls
This commit is contained in:
parent
00211e5495
commit
bba4542867
@ -8,12 +8,42 @@ sudo apt-get install unzip
|
|||||||
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
|
|
||||||
TF_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M ".current_version")
|
retry=0
|
||||||
wget -O terraform.zip https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_amd64.zip
|
while true;do
|
||||||
wget -O terraform.sha256 https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_SHA256SUMS
|
TF_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M ".current_version") && break || ((retry++))
|
||||||
wget -O terraform.sha256.sig https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_SHA256SUMS.sig
|
((retry >= 10)) && break
|
||||||
curl -s https://keybase.io/hashicorp/pgp_keys.asc | gpg --import
|
done
|
||||||
gpg --verify terraform.sha256.sig terraform.sha256
|
|
||||||
|
retry=0
|
||||||
|
while true;do
|
||||||
|
wget -O terraform.zip https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_amd64.zip && break || ((retry++))
|
||||||
|
((retry >= 10)) && break
|
||||||
|
done
|
||||||
|
|
||||||
|
retry=0
|
||||||
|
while true;do
|
||||||
|
wget -O terraform.sha256 https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_SHA256SUMS && break || ((retry++))
|
||||||
|
((retry >= 10)) && break
|
||||||
|
done
|
||||||
|
|
||||||
|
retry=0
|
||||||
|
while true;do
|
||||||
|
wget -O terraform.sha256.sig https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_SHA256SUMS.sig && break || ((retry++))
|
||||||
|
((retry >= 10)) && break
|
||||||
|
done
|
||||||
|
|
||||||
|
retry=0
|
||||||
|
while true;do
|
||||||
|
curl -s https://keybase.io/hashicorp/pgp_keys.asc | gpg --import && break || ((retry++))
|
||||||
|
((retry >= 10)) && break
|
||||||
|
done
|
||||||
|
|
||||||
|
retry=0
|
||||||
|
while true;do
|
||||||
|
gpg --verify terraform.sha256.sig terraform.sha256 && break || ((retry++))
|
||||||
|
((retry >= 10)) && break
|
||||||
|
done
|
||||||
|
|
||||||
echo $(grep -Po "[[:xdigit:]]{64}(?=\s+terraform_${TF_VERSION}_linux_amd64.zip)" terraform.sha256) terraform.zip | sha256sum -c
|
echo $(grep -Po "[[:xdigit:]]{64}(?=\s+terraform_${TF_VERSION}_linux_amd64.zip)" terraform.sha256) terraform.zip | sha256sum -c
|
||||||
unzip terraform.zip
|
unzip terraform.zip
|
||||||
mv terraform /usr/local/bin
|
mv terraform /usr/local/bin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user