forked from InfoSec812/sonar-auth-google
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis.sh
executable file
·22 lines (18 loc) · 924 Bytes
/
travis.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
set -euo pipefail
# Fetch all commit history so that SonarQube has exact blame information
# for issue auto-assignment
# This command can fail with "fatal: --unshallow on a complete repository does not make sense"
# if there are not enough commits in the Git repository (even if Travis executed git clone --depth 50).
# For this reason errors are ignored with "|| true"
git fetch --unshallow || true
echo "Generating release notes from git history"
mkdir -p target
git show -s --pretty=format:"%h - %<|(35)%ai - %an - %s" $(git rev-list --tags --max-count=1)...$(git show | grep "^commit" | awk '{print $2}') | tee target/RELEASE_NOTES
export MAVEN_OPTS="-Xmx1G -Xms128m"
mvn package cobertura:cobertura verify sonar:sonar \
-Dmaven.test.redirectTestOutputToFile=false \
-Dsonar.host.url=${SONAR_HOST_URL} \
-Dsonar.organization=${SONAR_ORG_KEY} \
-Dsonar.login=${SONAR_TOKEN} \
-B -e -V