-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
46 lines (46 loc) · 1.54 KB
/
.travis.yml
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
37
38
39
40
41
42
43
44
45
46
dist: trusty
language: java
python:
- "3.4"
addons:
sonarcloud:
organization: $SONAR_ORG
token:
secure: $SONAR_TOKEN
jdk:
- openjdk8
service:
- docker
before_install:
- sudo apt-get -y install python3-pip python-dev
- python3 -V
- pip3 -V
install:
- sudo pip3 install requests
jobs:
include:
- stage: unit test
script:
- cd server
- gradle build
- stage: code scan
script:
- python ./configsonar.py $SONAR_ORG:singleton-service:$TRAVIS_BRANCH $SONAR_ORG:singleton-service:$TRAVIS_BRANCH $SONAR_ORG service-gate $SONAR_TOKEN
- cd ws
- sed -i "s/singleton-service/$SONAR_ORG:singleton-service:$TRAVIS_BRANCH/" settings.gradle
- cat settings.gradle
- gradle sonarqube --stacktrace -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=$SONAR_ORG -Dsonar.branch.name=master --info
- cd .. && chmod 777 checkSonarQualityGateByAPI && ./checkSonarQualityGateByAPI -ProjectKeyPrefixArray=$SONAR_ORG:singleton-service:$TRAVIS_BRANCH
- stage: auto test
script:
- cd build && jar -cvf0m service.jar ./META-INF/MANIFEST.MF ./org/ ./BOOT-INF/ ./resources.zip
- cp service.jar ../
- cd ..
- docker build -t singleton .
- docker run -d -p 8090:8090 --name singleton singleton
- docker ps
- git clone --branch=devops https://github.com/singleton-demo/ci.git devops
- ls
- cd devops/autotest/server/APITest && gradle build
- docker cp l10n singleton:/
- java -cp "target/*:resource/*" org.testng.TestNG testng.xml