blob: bc1c84786c3ace35bb47f4856f6227a67f756bef [file] [log] [blame]
Junxiao Shi439d9722015-03-20 15:08:44 -07001#!/usr/bin/env bash
2set -e
Davide Pesaventod8398822020-03-29 18:46:19 -04003source .jenkins.d/util.sh
Junxiao Shi439d9722015-03-20 15:08:44 -07004
Davide Pesaventod8398822020-03-29 18:46:19 -04005export CACHE_DIR=${CACHE_DIR:-/tmp}
Davide Pesaventoa1a9d702020-03-29 00:58:15 -04006export WAF_JOBS=${WAF_JOBS:-1}
Davide Pesaventod5c24472020-04-01 17:46:18 -04007[[ $JOB_NAME == *"code-coverage" ]] && export DISABLE_ASAN=yes
Davide Pesaventoa1a9d702020-03-29 00:58:15 -04008
Davide Pesaventocbef7b82019-10-09 00:15:13 -04009nanos() {
10 # Cannot use date(1) because macOS does not support %N format specifier
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040011 python3 -c 'import time; print(int(time.time() * 1e9))'
Davide Pesaventocbef7b82019-10-09 00:15:13 -040012}
Junxiao Shi439d9722015-03-20 15:08:44 -070013
Davide Pesaventocbef7b82019-10-09 00:15:13 -040014for file in .jenkins.d/*; do
Junxiao Shi439d9722015-03-20 15:08:44 -070015 [[ -f $file && -x $file ]] || continue
Davide Pesaventocbef7b82019-10-09 00:15:13 -040016
17 if [[ -n $TRAVIS ]]; then
18 label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/')
19 echo -ne "travis_fold:start:${label}\r"
20 echo -ne "travis_time:start:${label}\r"
21 start=$(nanos)
22 fi
23
24 echo "\$ $file"
Junxiao Shi439d9722015-03-20 15:08:44 -070025 "$file"
Davide Pesaventocbef7b82019-10-09 00:15:13 -040026
27 if [[ -n $TRAVIS ]]; then
28 finish=$(nanos)
29 echo -ne "travis_time:end:${label}:start=${start},finish=${finish},duration=$((finish-start)),event=${label}\r"
30 echo -ne "travis_fold:end:${label}\r"
31 fi
Junxiao Shi439d9722015-03-20 15:08:44 -070032done