forked from arkuznetsov/yabr.os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis.sh
34 lines (29 loc) · 1.04 KB
/
travis.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
#!/bin/bash
set -e
sudo opm run coverage
temp=`cat packagedef | grep ".Версия(" | sed 's|[^"]*"||' | sed -r 's/".+//'`
version=${temp##*|}
if [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
sonar-scanner \
-Dsonar.host.url=$SONAR_HOST \
-Dsonar.analysis.mode=issues \
-Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST \
-Dsonar.github.repository=$TRAVIS_REPO_SLUG \
-Dsonar.github.oauth=$SONAR_GITHUB_TOKEN \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.scm.enabled=true \
-Dsonar.scm.provider=git \
-Dsonar.scanner.skip=false \
-Dsonar.branch.name=master
elif [ "$TRAVIS_BRANCH" == "develop" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
sonar-scanner \
-Dsonar.host.url=$SONAR_HOST \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.projectVersion=$version \
-Dsonar.scm.enabled=true \
-Dsonar.scm.provider=git \
-Dsonar.scanner.skip=false \
-Dsonar.branch.name=master
fi
fi