blob: 78e1ca13502de03cee35740804e8c22b6d20b37c [file] [log] [blame]
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07001#!/usr/bin/env bash
2set -e
3
Davide Pesavento4bd4f712019-10-09 01:02:45 -04004nanos() {
5 # Cannot use date(1) because macOS does not support %N format specifier
6 python -c 'import time; print(int(time.time() * 1e9))'
7}
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07008
Davide Pesavento4bd4f712019-10-09 01:02:45 -04009for file in .jenkins.d/*; do
Alexander Afanasyev6077b392014-12-11 22:56:23 -080010 [[ -f $file && -x $file ]] || continue
Davide Pesavento4bd4f712019-10-09 01:02:45 -040011
12 if [[ -n $TRAVIS ]]; then
13 label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/')
14 echo -ne "travis_fold:start:${label}\r"
15 echo -ne "travis_time:start:${label}\r"
16 start=$(nanos)
17 fi
18
19 echo "\$ $file"
Alexander Afanasyev6077b392014-12-11 22:56:23 -080020 "$file"
Davide Pesavento4bd4f712019-10-09 01:02:45 -040021
22 if [[ -n $TRAVIS ]]; then
23 finish=$(nanos)
24 echo -ne "travis_time:end:${label}:start=${start},finish=${finish},duration=$((finish-start)),event=${label}\r"
25 echo -ne "travis_fold:end:${label}\r"
26 fi
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070027done