-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.travis.yml
More file actions
32 lines (26 loc) · 783 Bytes
/
.travis.yml
File metadata and controls
32 lines (26 loc) · 783 Bytes
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
sudo: required
services:
- docker
language: java
jdk:
- openjdk8
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
env:
- JAR_FILE=target/server-1.0-SNAPSHOT.jar
addons:
sonarcloud:
organization: apicollab-github
token:
secure: ${SONAR_TOKEN}
script:
- mvn org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar
after_success:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BUILD_NUMBER; fi`
- export IMAGE_NAME=apicollab/server
- docker build -t $IMAGE_NAME:$TRAVIS_COMMIT --build-arg JAR_FILE=${JAR_FILE} .
- docker tag $IMAGE_NAME:$TRAVIS_COMMIT $IMAGE_NAME:$TAG
- docker push $IMAGE_NAME