зеркало из https://github.com/mozilla/hubs-ops.git
Fix hab discovery script
This commit is contained in:
Родитель
7309565e8e
Коммит
75cf7cab40
|
@ -15,7 +15,7 @@ ENV=""
|
||||||
|
|
||||||
# There is a race condition on EC2 metadata, it can be not ready yet or have no tags yet.
|
# There is a race condition on EC2 metadata, it can be not ready yet or have no tags yet.
|
||||||
while [[ -z "$EC2_INFO" || -z "$HAB_RING" || -z "$ENV" ]] ; do
|
while [[ -z "$EC2_INFO" || -z "$HAB_RING" || -z "$ENV" ]] ; do
|
||||||
EC2_INFO=$(aws ec2 --region us-west-1 describe-instances --instance-ids $INSTANCE_ID)
|
EC2_INFO=$(aws ec2 --region us-west-1 describe-instances --no-paginate)
|
||||||
|
|
||||||
# Get the ring name
|
# Get the ring name
|
||||||
HAB_RING=$(echo "$EC2_INFO" | jq -r ".Reservations | map(.Instances) | flatten | .[] | select(.InstanceId == \"$INSTANCE_ID\") | .Tags | .[]? | select(.Key == \"hab-ring\") | .Value ")
|
HAB_RING=$(echo "$EC2_INFO" | jq -r ".Reservations | map(.Instances) | flatten | .[] | select(.InstanceId == \"$INSTANCE_ID\") | .Tags | .[]? | select(.Key == \"hab-ring\") | .Value ")
|
||||||
|
|
Загрузка…
Ссылка в новой задаче