Skip to content

Commit

Permalink
Update the travis_wait verbose implementation to match the upstream
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
adrianbroher committed Nov 5, 2016
1 parent 9b127ce commit 9f65d1d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ cache:
directories:
- build/downloads
before_script:
# Make travis_wait more verbose
- . .travis_wait_transparent
# Use a more verbose travis_wait implementation
- . .travis_wait
# Delete the outdated `/C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA` certificate
- sudo security delete-certificate -Z 2F173F7DE99667AFA57AF80AA2D1B12FAC830338 /System/Library/Keychains/SystemRootCertificates.keychain
- rvm osx-ssl-certs update $(travis_internal_ruby)
- mkdir -p build
- cd build
script:
- cmake -G "Xcode" -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk ..
- travis_wait_transparent 70 cmake --build . --config RelWithDebInfo
- travis_wait 70 cmake --build . --config RelWithDebInfo
deploy:
provider: releases
api-key:
Expand Down
38 changes: 38 additions & 0 deletions .travis_wait
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

unset -f travis_wait

travis_wait() {
local timeout=$1

if [[ $timeout =~ ^[0-9]+$ ]]; then
# looks like an integer, so we assume it's a timeout
shift
else
# default value
timeout=20
fi

local cmd="$@"

$cmd &
local cmd_pid=$!

travis_jigger $! $timeout $cmd &
local jigger_pid=$!
local result

{
wait $cmd_pid 2>/dev/null
result=$?
ps -p$jigger_pid &>/dev/null && kill $jigger_pid
} || return 1

if [ $result -eq 0 ]; then
echo -e "\n${ANSI_GREEN}The command \"$TRAVIS_CMD\" exited with $result.${ANSI_RESET}"
else
echo -e "\n${ANSI_RED}The command \"$TRAVIS_CMD\" exited with $result.${ANSI_RESET}"
fi

return $result
}
33 changes: 0 additions & 33 deletions .travis_wait_transparent

This file was deleted.

0 comments on commit 9f65d1d

Please sign in to comment.