.travis.yml: Prevent nightly jobs from timing out (again) (#7238)
* .travis.yml: Add tick() and retry() functions * .travis.yml: Remove superfluous 'docker info' commands The docker info command is ran during the install phase. There is no need to run it again * .travis.yml: Use the tick() function instead of travis_wait()
This commit is contained in:
parent
590c835f7d
commit
2657f91142
|
@ -10,7 +10,8 @@ matrix:
|
|||
allow_failures:
|
||||
- env: ALLOW_SOFT_FAILURE_HERE=true
|
||||
|
||||
|
||||
before_install:
|
||||
- source .travis/utils.sh
|
||||
|
||||
# Install dependencies for all, once
|
||||
#
|
||||
|
@ -493,10 +494,9 @@ jobs:
|
|||
- echo "Last commit:" && git log -1
|
||||
- echo "GIT Describe:" && git describe
|
||||
- echo "packaging/version:" && cat packaging/version
|
||||
- docker info
|
||||
- packaging/docker/check_login.sh
|
||||
&& echo "Switching to latest master branch, to pick up tagging if any" && git checkout master && git pull
|
||||
&& travis_wait 20 packaging/docker/build.sh
|
||||
&& tick packaging/docker/build.sh
|
||||
&& packaging/docker/publish.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "<!here> Docker image publishing failed"
|
||||
|
||||
|
@ -591,9 +591,8 @@ jobs:
|
|||
- echo "Last commit:" && git log -1
|
||||
- echo "GIT Describe:" && git describe
|
||||
- echo "packaging/version:" && cat packaging/version
|
||||
- docker info
|
||||
- packaging/docker/check_login.sh
|
||||
&& travis_wait 20 packaging/docker/build.sh
|
||||
&& tick packaging/docker/build.sh
|
||||
&& packaging/docker/publish.sh
|
||||
after_failure: post_message "TRAVIS_MESSAGE" "<!here> Nightly docker image publish failed"
|
||||
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Prevent travis from timing out after 10 minutes of no output
|
||||
tick() {
|
||||
(while true; do sleep 300; echo; done) &
|
||||
local PID=$!
|
||||
disown
|
||||
|
||||
"$@"
|
||||
local RET=$?
|
||||
|
||||
kill $PID
|
||||
return $RET
|
||||
}
|
||||
|
||||
retry() {
|
||||
local tries=$1
|
||||
shift
|
||||
|
||||
local i=0
|
||||
while [ "$i" -lt "$tries" ]; do
|
||||
"$@" && return 0
|
||||
sleep $((2**((i++))))
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
Loading…
Reference in New Issue