xref: /OpenGrok/dev/main (revision d5980033a702d55fb90bb4a26c8cb1ae73a05e33)
1aba5f4cfSVladimir Kotal#!/bin/bash
2aba5f4cfSVladimir Kotal
3aba5f4cfSVladimir Kotal#
4cb86d517SVladimir Kotal# Do not run coverage for forks as most people do not have extra tools enabled
54ff8cd68SVladimir Kotal# for their fork. Avoid it also for release builds as that can fail such
64ff8cd68SVladimir Kotal# build unnecessarily.
7aba5f4cfSVladimir Kotal#
8bf78b550SVladimir Kotal
9bf78b550SVladimir Kotalif [[ -n $OPENGROK_REF && $OPENGROK_REF == refs/heads/* ]]; then
10bf78b550SVladimir Kotal	OPENGROK_BRANCH=${OPENGROK_REF#"refs/heads/"}
11bf78b550SVladimir Kotalfi
12bf78b550SVladimir Kotal
13aba5f4cfSVladimir Kotalextra_args=""
14bf78b550SVladimir Kotalif [[ "x$OPENGROK_REPO_SLUG" == "xoracle/opengrok" && "x$OPENGROK_BRANCH" == "xmaster" ]]; then
153db07792SVladimir Kotal	echo "Enabling Coveralls"
16*d5980033SVladimir Kotal	if [[ -n $OPENGROK_COVERALLS_TOKEN ]]; then
17*d5980033SVladimir Kotal		extra_args="$extra_args -DrepoToken=$OPENGROK_COVERALLS_TOKEN"
18*d5980033SVladimir Kotal	fi
19*d5980033SVladimir Kotal	extra_args="$extra_args jacoco:report coveralls:report"
2064cffec5SVladimir Kotal
2164cffec5SVladimir Kotal	#
2264cffec5SVladimir Kotal	# Sonar seems to only work on master branch commits.
2364cffec5SVladimir Kotal	#
24d06d067eSVladimir Kotal	if [ "${OPENGROK_PULL_REQUEST}" = "false" ]; then
2564cffec5SVladimir Kotal		echo "Enabling Sonar"
26cb86d517SVladimir Kotal		extra_args="$extra_args sonar:sonar"
27aba5f4cfSVladimir Kotal	fi
2864cffec5SVladimir Kotalfi
29aba5f4cfSVladimir Kotal
30d5d2ac4cSVladimir Kotal./mvnw -B -V verify $extra_args
31