blob: bc1c84786c3ace35bb47f4856f6227a67f756bef [file] [log] [blame]
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07001#!/usr/bin/env bash
Vince Lehman0a7da612014-10-29 14:39:29 -05002set -e
Davide Pesaventof6be8e32020-04-30 16:06:03 -04003source .jenkins.d/util.sh
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07004
Davide Pesaventof6be8e32020-04-30 16:06:03 -04005export CACHE_DIR=${CACHE_DIR:-/tmp}
6export WAF_JOBS=${WAF_JOBS:-1}
7[[ $JOB_NAME == *"code-coverage" ]] && export DISABLE_ASAN=yes
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07008
Davide Pesaventof6be8e32020-04-30 16:06:03 -04009nanos() {
10 # Cannot use date(1) because macOS does not support %N format specifier
11 python3 -c 'import time; print(int(time.time() * 1e9))'
12}
13
14for file in .jenkins.d/*; do
Nick Gd69f9a32016-08-23 11:30:02 -050015 [[ -f $file && -x $file ]] || continue
Davide Pesaventof6be8e32020-04-30 16:06:03 -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"
Nick Gd69f9a32016-08-23 11:30:02 -050025 "$file"
Davide Pesaventof6be8e32020-04-30 16:06:03 -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
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070032done