From 4820edf2479709235e8f0e7e72a8881157880894 Mon Sep 17 00:00:00 2001 From: Pierre Beitz Date: Fri, 23 Oct 2020 11:28:07 +0200 Subject: [PATCH] chore: slickify terraform script thanks @fatz! --- scripts/terraform/up.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/terraform/up.sh b/scripts/terraform/up.sh index 41ff9b2aef..35c1e978b0 100755 --- a/scripts/terraform/up.sh +++ b/scripts/terraform/up.sh @@ -6,16 +6,11 @@ ssh-keygen -t rsa -N "" -f ~/.ssh/$TF_VAR_variant ssh-add ~/.ssh/$TF_VAR_variant echo "Running terraform init" -for i in {1..3}; do terraform init && break; done +for i in {1..3}; do terraform init --upgrade && break; done echo "Running terraform apply. This may take a while. Expect 15 minutes." # we try to recover a couple times in case the first try did not work - which currently happens frequently. -for i in {1..3}; do terraform apply -auto-approve > ./log && break; done - -cat log - -# something like `cluster-address = dcos-ui-system-tests-1371554912.us-west-2.elb.amazonaws.com` -line=$(grep -o "cluster-address = \S*" ./log | head -n1) +for i in {1..3}; do terraform apply -auto-approve && break; done # print that cluster url -echo http://$(echo $line | cut -d" " -f3) +echo http://$(terraform output cluster-address)