blob: 78e1ca13502de03cee35740804e8c22b6d20b37c [file] [log] [blame]
Junxiao Shi439d9722015-03-20 15:08:44 -07001#!/usr/bin/env bash
2set -e
3
Davide Pesaventocbef7b82019-10-09 00:15:13 -04004nanos() {
5 # Cannot use date(1) because macOS does not support %N format specifier
6 python -c 'import time; print(int(time.time() * 1e9))'
7}
Junxiao Shi439d9722015-03-20 15:08:44 -07008
Davide Pesaventocbef7b82019-10-09 00:15:13 -04009for file in .jenkins.d/*; do
Junxiao Shi439d9722015-03-20 15:08:44 -070010 [[ -f $file && -x $file ]] || continue
Davide Pesaventocbef7b82019-10-09 00:15:13 -040011
12 if [[ -n $TRAVIS ]]; then
13 label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/')
14 echo -ne "travis_fold:start:${label}\r"
15 echo -ne "travis_time:start:${label}\r"
16 start=$(nanos)
17 fi
18
19 echo "\$ $file"
Junxiao Shi439d9722015-03-20 15:08:44 -070020 "$file"
Davide Pesaventocbef7b82019-10-09 00:15:13 -040021
22 if [[ -n $TRAVIS ]]; then
23 finish=$(nanos)
24 echo -ne "travis_time:end:${label}:start=${start},finish=${finish},duration=$((finish-start)),event=${label}\r"
25 echo -ne "travis_fold:end:${label}\r"
26 fi
Junxiao Shi439d9722015-03-20 15:08:44 -070027done