forked from jenkinsci/acceptance-test-harness
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathset-java.sh
executable file
·34 lines (31 loc) · 977 Bytes
/
set-java.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
# Inspired by https://disconnected.systems/blog/another-bash-strict-mode/
set -uo pipefail
trap 's=$?; echo >&2 "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
# The selection used by update-alternatives for each java version
if [ "$1" == "11" ]; then
selection="java-11-openjdk.$(arch)"
elif [ "$1" == "8" ]; then
selection="java-1.8.0-openjdk.$(arch)"
else
echo >&2 "Unsupported java version '${1}'"
exit 1
fi
# For some reason, all tools from JDK are split to 2 groups named java and javac
update-alternatives --set java "$selection"
update-alternatives --set javac "$selection"
echo
echo -------------------- INFORMATION --------------------
echo Running on...
java -version
echo
javac -version
echo
echo Start running tests with...
echo
echo 'eval $(vnc.sh)'
echo
echo run.sh firefox latest -DforkCount=1 -Dmaven.test.failure.ignore=true -B -Dtest=...
echo
echo ------------------ END INFORMATION ------------------
echo