oem/ami: reduce parallelism

The EC2 builder doesn't have enough resources to run all of these in parallel.
Instead, copy the PV images and then copy the HVM images.
This commit is contained in:
Alex Crawford 2016-03-26 10:12:40 -07:00
parent 4744e3f96c
commit e778acd713

View File

@ -149,6 +149,25 @@ do
[ "${r}" == "${region}" ] && continue
do_copy "$r" pv "$AMI" &
WAIT_PIDS+=( $! )
done
# wait for each subshell individually to report errors
WAIT_FAILED=0
for wait_pid in "${WAIT_PIDS[@]}"; do
if ! wait ${wait_pid}; then
: $(( WAIT_FAILED++ ))
fi
done
if [[ ${WAIT_FAILED} -ne 0 ]]; then
echo "${WAIT_FAILED} jobs failed :(" >&2
exit ${WAIT_FAILED}
fi
WAIT_PIDS=()
for r in "${REGIONS[@]}"
do
[ "${r}" == "${region}" ] && continue
if [[ -n "$HVM" ]]; then
do_copy "$r" hvm "$HVM" &
WAIT_PIDS+=( $! )