forked from jenkinsci/acceptance-test-harness
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci.sh
More file actions
executable file
·36 lines (27 loc) · 1.05 KB
/
ci.sh
File metadata and controls
executable file
·36 lines (27 loc) · 1.05 KB
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
35
36
#!/usr/bin/env bash
set -uo pipefail
jdk="$1"
browser="$2"
jenkinsVersion="$3"
# Obtain the group ID to grant to access the Docker socket
if [[ -z ${DOCKER_GID:-} ]]; then
DOCKER_GID=$(docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:Z ubuntu:noble stat -c %g /var/run/docker.sock) || exit 1
export DOCKER_GID
fi
trap 'docker-compose kill && docker-compose down' EXIT
docker-compose run -e "MAVEN_ARGS=${MAVEN_ARGS}" --name mvn -T --rm -v "${MAVEN_SETTINGS}:${MAVEN_SETTINGS}:Z" mvn bash -s <<-INSIDE
set-java.sh ${jdk}
# Ensure that Jenkins node setup does not influence the container Java setup
unset JAVA_HOME
java -version
mvn -v
run.sh remote-webdriver-${browser} ${jenkinsVersion} -Dmaven.test.failure.ignore=true -Dcsp.rule -DforkCount=1 -B
INSIDE
status=$?
if [[ -d target/surefire-reports ]]; then
find target/surefire-reports -type f -name 'TEST-*.xml' -print0 |
xargs -0 sed -i 's!\[\[ATTACHMENT|/home/ath-user/sources/target\(/[^]]*\)\]\]![[ATTACHMENT|'"$PWD"'/target\1]]!g'
else
echo 'No test results to be saved'
fi
exit $status