blob: bc1c84786c3ace35bb47f4856f6227a67f756bef [file] [log] [blame]
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04001#!/usr/bin/env bash
Alexander Afanasyev33ce4c32014-10-24 11:19:45 -07002set -e
Davide Pesavento2349e282020-03-24 14:28:03 -04003source .jenkins.d/util.sh
4
Davide Pesaventoab7300b2020-04-09 00:51:41 -04005export CACHE_DIR=${CACHE_DIR:-/tmp}
Davide Pesavento2349e282020-03-24 14:28:03 -04006export WAF_JOBS=${WAF_JOBS:-1}
Davide Pesaventoab7300b2020-04-09 00:51:41 -04007[[ $JOB_NAME == *"code-coverage" ]] && export DISABLE_ASAN=yes
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04008
Davide Pesaventoe6e125e2019-10-08 18:08:36 -04009nanos() {
10 # Cannot use date(1) because macOS does not support %N format specifier
Davide Pesaventod776a932020-03-20 18:42:36 -040011 python3 -c 'import time; print(int(time.time() * 1e9))'
Davide Pesaventoe6e125e2019-10-08 18:08:36 -040012}
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040013
Davide Pesaventoe6e125e2019-10-08 18:08:36 -040014for file in .jenkins.d/*; do
Alexander Afanasyeve7490032014-12-11 12:40:53 -080015 [[ -f $file && -x $file ]] || continue
Davide Pesaventoe6e125e2019-10-08 18:08:36 -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"
Alexander Afanasyeve7490032014-12-11 12:40:53 -080025 "$file"
Davide Pesaventoe6e125e2019-10-08 18:08:36 -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 Afanasyeva87e0a82014-10-21 14:09:19 -040032done