Skip to content

Commit

Permalink
chore: slickify terraform script
Browse files Browse the repository at this point in the history
thanks @fatz!
  • Loading branch information
pierrebeitz committed Oct 26, 2020
1 parent fed54a5 commit 4820edf
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions scripts/terraform/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 4820edf

Please sign in to comment.