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