xref: /OpenGrok/dev/main (revision 767d112dd43415435c5de068044fce96666ea99c)
1#!/bin/bash
2
3#
4# Do not run coverage for forks as most people do not have extra tools enabled
5# for their fork. Avoid it also for release builds as that can fail such
6# build unnecessarily.
7#
8
9if [[ -n $OPENGROK_REF && $OPENGROK_REF == refs/heads/* ]]; then
10	OPENGROK_BRANCH=${OPENGROK_REF#"refs/heads/"}
11fi
12
13extra_args=""
14if [[ "x$OPENGROK_REPO_SLUG" == "xoracle/opengrok" && "x$OPENGROK_BRANCH" == "xmaster" ]]; then
15	echo "Enabling Coveralls"
16	if [[ -n $OPENGROK_COVERALLS_TOKEN ]]; then
17		extra_args="$extra_args -DrepoToken=$OPENGROK_COVERALLS_TOKEN"
18	fi
19	extra_args="$extra_args jacoco:report coveralls:report"
20
21	#
22	# Sonar seems to only work on master branch commits.
23	#
24	if [[ -z "${OPENGROK_PULL_REQUEST}" ]]; then
25		echo "Enabling Sonar"
26		extra_args="$extra_args -P sonar -Dsonar.login=$OPENGROK_SONAR_TOKEN sonar:sonar"
27	fi
28fi
29
30./mvnw -B -V verify $extra_args
31