Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.

Commit b35d6a7

Browse files
authored
Merge pull request #172 from nathanchance/build-all-sh
build-all.sh: Initial revision
2 parents fae1165 + 0eefc46 commit b35d6a7

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

build-all.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
# shellcheck disable=SC1117
3+
4+
function format_time() {(
5+
MINS=$(((${2} - ${1}) / 60))
6+
SECS=$(((${2} - ${1}) % 60))
7+
8+
if [[ ${MINS} -ge 60 ]]; then
9+
HOURS=$((MINS / 60))
10+
MINS=$((MINS % 60))
11+
fi
12+
13+
[[ -n ${HOURS} ]] && TIME_STRING="${HOURS}h "
14+
echo "${TIME_STRING}${MINS}m ${SECS}s"
15+
)}
16+
17+
BLD_ALL_START=$(date +%s)
18+
GREEN="\033[01;32m"
19+
RED="\033[01;31m"
20+
RESET="\033[0m"
21+
22+
echo
23+
grep "env:" .travis.yml | grep -v LLVM_VERSION | sed "s/.*env: //g" | while read -r ITEM; do (
24+
DRIVER_START=$(date +%s)
25+
read -ra VALUES <<< "${ITEM}"
26+
for VALUE in "${VALUES[@]}"; do
27+
export "${VALUE:?}"
28+
done
29+
30+
# Make sure that the version suffix is stripped for local builds,
31+
# where it is assumed that the user will be using a tip of tree build
32+
[[ -n ${LD} ]] && export LD=${LD//-*}
33+
34+
echo -e "Running '${ARCH:+ARCH=${ARCH} }${LD:+LD=${LD} }${REPO:+REPO=${REPO} }./driver.sh'... \c"
35+
if ! ./driver.sh "${@}" &>/dev/null; then
36+
echo -e "${RED}Failed${RESET}\c"
37+
else
38+
echo -e "${GREEN}Successful${RESET}\c"
39+
fi
40+
echo " in $(format_time "${DRIVER_START}" "$(date +%s)")"
41+
) done
42+
43+
echo
44+
echo "Total script time: $(format_time "${BLD_ALL_START}" "$(date +%s)")"
45+
echo

0 commit comments

Comments
 (0)