mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 05:56:58 +02:00
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:
parent
4744e3f96c
commit
e778acd713
@ -149,6 +149,25 @@ do
|
|||||||
[ "${r}" == "${region}" ] && continue
|
[ "${r}" == "${region}" ] && continue
|
||||||
do_copy "$r" pv "$AMI" &
|
do_copy "$r" pv "$AMI" &
|
||||||
WAIT_PIDS+=( $! )
|
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
|
if [[ -n "$HVM" ]]; then
|
||||||
do_copy "$r" hvm "$HVM" &
|
do_copy "$r" hvm "$HVM" &
|
||||||
WAIT_PIDS+=( $! )
|
WAIT_PIDS+=( $! )
|
||||||
|
Loading…
Reference in New Issue
Block a user