mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add CI script to retry builds
This commit is contained in:
parent
4c4df37a12
commit
26a6ed5873
1 changed files with 17 additions and 0 deletions
17
etc/ci/retry.sh
Executable file
17
etc/ci/retry.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Retries a given command until it passes
|
||||
# Run as `retry.sh N command args...`
|
||||
# where `N` is the maximum number of tries, and `command args...` is the
|
||||
# command to run, with arguments
|
||||
|
||||
n=$1
|
||||
shift; # this removes the first argument from $@
|
||||
for i in `seq $n`; do
|
||||
echo "====== RUN NUMBER: $i ======";
|
||||
if $@ # run command, check if exit code is zero
|
||||
then
|
||||
exit 0 # command passed, all is well
|
||||
fi
|
||||
done
|
||||
exit 1
|
Loading…
Add table
Add a link
Reference in a new issue