github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/builtin/foundation/consul/data/common/deploy/module-aws/join.sh (about)

     1  #!/bin/bash
     2  
     3  echo "Waiting for Consul join..."
     4  
     5  TRIES=10
     6  
     7  until consul join $1; do
     8    let TRIES-=1
     9  
    10    echo "Consul join failed. Retries left: $TRIES"
    11    if [ $TRIES -le 0 ]; then
    12      # Update the "magic" key in Consul that says "no deploys!"
    13      echo "Could not reach application, assuming it failed to start!"
    14      exit 27
    15    fi
    16  
    17    sleep 2
    18  done