feat(rebuild): parallelise rebuild script
This commit is contained in:
parent
94f9496604
commit
74b315fc39
1 changed files with 13 additions and 3 deletions
|
@ -23,9 +23,19 @@ main() {
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
all)
|
all)
|
||||||
rebuild_remote nemesis &&
|
# Create a list of hostnames to rebuild
|
||||||
rebuild_remote apollo
|
hosts=("nemesis" "apollo")
|
||||||
exit 0
|
|
||||||
|
# Use parallel to rebuild each host
|
||||||
|
, parallel rebuild ::: "${hosts[@]}"
|
||||||
|
|
||||||
|
# Check the exit code of parallel
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
echo "One or more rebuilds failed."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
rebuild_remote "$1"
|
rebuild_remote "$1"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue