blob: 287bdd7dbc16beba1419bbc0a4a4ee7121d54f28 [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}
7
Davide Pesaventocbef7b82019-10-09 00:15:13 -04008nanos() {
9 # Cannot use date(1) because macOS does not support %N format specifier
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040010 python3 -c 'import time; print(int(time.time() * 1e9))'
Davide Pesaventocbef7b82019-10-09 00:15:13 -040011}
Junxiao Shi439d9722015-03-20 15:08:44 -070012
Davide Pesaventocbef7b82019-10-09 00:15:13 -040013for file in .jenkins.d/*; do
Junxiao Shi439d9722015-03-20 15:08:44 -070014 [[ -f $file && -x $file ]] || continue
Davide Pesaventocbef7b82019-10-09 00:15:13 -040015
16 if [[ -n $TRAVIS ]]; then
17 label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/')
18 echo -ne "travis_fold:start:${label}\r"
19 echo -ne "travis_time:start:${label}\r"
20 start=$(nanos)
21 fi
22
23 echo "\$ $file"
Junxiao Shi439d9722015-03-20 15:08:44 -070024 "$file"
Davide Pesaventocbef7b82019-10-09 00:15:13 -040025
26 if [[ -n $TRAVIS ]]; then
27 finish=$(nanos)
28 echo -ne "travis_time:end:${label}:start=${start},finish=${finish},duration=$((finish-start)),event=${label}\r"
29 echo -ne "travis_fold:end:${label}\r"
30 fi
Junxiao Shi439d9722015-03-20 15:08:44 -070031done