Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Alexander Afanasyev | 33ce4c3 | 2014-10-24 11:19:45 -0700 | [diff] [blame] | 2 | set -e |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame^] | 3 | source .jenkins.d/util.sh |
| 4 | |
| 5 | export WAF_JOBS=${WAF_JOBS:-1} |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 6 | |
Davide Pesavento | e6e125e | 2019-10-08 18:08:36 -0400 | [diff] [blame] | 7 | nanos() { |
| 8 | # Cannot use date(1) because macOS does not support %N format specifier |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 9 | python3 -c 'import time; print(int(time.time() * 1e9))' |
Davide Pesavento | e6e125e | 2019-10-08 18:08:36 -0400 | [diff] [blame] | 10 | } |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 11 | |
Davide Pesavento | e6e125e | 2019-10-08 18:08:36 -0400 | [diff] [blame] | 12 | for file in .jenkins.d/*; do |
Alexander Afanasyev | e749003 | 2014-12-11 12:40:53 -0800 | [diff] [blame] | 13 | [[ -f $file && -x $file ]] || continue |
Davide Pesavento | e6e125e | 2019-10-08 18:08:36 -0400 | [diff] [blame] | 14 | |
| 15 | if [[ -n $TRAVIS ]]; then |
| 16 | label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/') |
| 17 | echo -ne "travis_fold:start:${label}\r" |
| 18 | echo -ne "travis_time:start:${label}\r" |
| 19 | start=$(nanos) |
| 20 | fi |
| 21 | |
| 22 | echo "\$ $file" |
Alexander Afanasyev | e749003 | 2014-12-11 12:40:53 -0800 | [diff] [blame] | 23 | "$file" |
Davide Pesavento | e6e125e | 2019-10-08 18:08:36 -0400 | [diff] [blame] | 24 | |
| 25 | if [[ -n $TRAVIS ]]; then |
| 26 | finish=$(nanos) |
| 27 | echo -ne "travis_time:end:${label}:start=${start},finish=${finish},duration=$((finish-start)),event=${label}\r" |
| 28 | echo -ne "travis_fold:end:${label}\r" |
| 29 | fi |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 30 | done |