jenkins: move retry+timeout out of groovy into shell
This commit is contained in:
parent
119a307645
commit
155e35b6fd
|
@ -220,14 +220,12 @@ def abortOnError(msg)
|
|||
|
||||
def fetchPR(prNum, fetchArgs, extraRefSpec)
|
||||
{
|
||||
retry(3) {
|
||||
timeout(time: 60, unit: 'SECONDS') {
|
||||
deleteDir()
|
||||
sh """git init
|
||||
if (( "\${RIOT_MIRROR}" )); then RIOT_URL="\${RIOT_MIRROR_URL}"; else RIOT_URL="https://github.com/RIOT-OS/RIOT"; fi
|
||||
git remote add origin "\${RIOT_URL}"
|
||||
git fetch -u -n ${fetchArgs} origin ${extraRefSpec} pull/${prNum}/merge:pull_${prNum}
|
||||
git checkout pull_${prNum}"""
|
||||
}
|
||||
}
|
||||
sh """git init
|
||||
if (( "\${RIOT_MIRROR}" )); then RIOT_URL="\${RIOT_MIRROR_URL}"; else RIOT_URL="https://github.com/RIOT-OS/RIOT"; fi
|
||||
git remote add origin "\${RIOT_URL}"
|
||||
for RETRIES in {1..3}; do
|
||||
timeout 30 git fetch -u -n ${fetchArgs} origin ${extraRefSpec} pull/${prNum}/merge:pull_${prNum} && break
|
||||
done
|
||||
[[ "\$RETRIES" -eq 3 ]] && exit 1
|
||||
git checkout pull_${prNum}"""
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue