From 9008c9cd5f2148065c586cc13c1c16e819717736 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 29 Sep 2015 14:48:38 +0200 Subject: [PATCH] Hack to parallelize AMI copying --- nixos/maintainers/scripts/ec2/create-amis.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/nixos/maintainers/scripts/ec2/create-amis.sh b/nixos/maintainers/scripts/ec2/create-amis.sh index cd4195adcfaa..8604091dbcdb 100755 --- a/nixos/maintainers/scripts/ec2/create-amis.sh +++ b/nixos/maintainers/scripts/ec2/create-amis.sh @@ -191,15 +191,17 @@ for type in hvm pv; do ami=$(cat $amiFile) fi - echo "waiting for AMI..." - while true; do - status=$(ec2-describe-images "$ami" --region "$region" | head -n1 | cut -f 5) - if [ "$status" = available ]; then break; fi - sleep 10 - done + if [ -z "$NO_WAIT" -o -z "$prevAmi" ]; then + echo "waiting for AMI..." + while true; do + status=$(ec2-describe-images "$ami" --region "$region" | head -n1 | cut -f 5) + if [ "$status" = available ]; then break; fi + sleep 10 + done - ec2-modify-image-attribute \ - --region "$region" "$ami" -l -a all + ec2-modify-image-attribute \ + --region "$region" "$ami" -l -a all + fi echo "region = $region, type = $type, store = $store, ami = $ami" if [ -z "$prevAmi" ]; then