-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
55 lines (43 loc) · 1.17 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
47
48
49
50
51
52
53
54
55
language: java
sudo: false
services:
- docker
env:
- DOCKER_IMAGE_NAME=tangocs/rest-server REGISTRY_USER=ingvord TANGO_HOST_IP=0.0.0.0
#skip mvn install
install:
- mvn package -Ptravis,test-suite
before_script:
- docker-compose up -d
#TODO wait-for-it
- sleep 30
- docker ps
script:
- mvn -B verify -Ptest-suite -Dcustom.build.name=$TRAVIS_BRANCH
after_script: docker rm -f "$DOCKER_IMAGE_NAME"
after_success:
- sleep 3
- git fetch --unshallow
- mvn sonar:sonar -Ptravis -Dsonar.login=$SONAR_TOKEN -Dsonar.projectKey=org.tango-controls:rest-server
- docker build --pull --tag "$DOCKER_IMAGE_NAME" --build-arg REST_SERVER_VERSION=$TRAVIS_BRANCH .
jdk:
- openjdk11
before_deploy:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS"
- docker tag "$DOCKER_IMAGE_NAME" "${DOCKER_IMAGE_NAME}:${TRAVIS_BRANCH}"
deploy:
- provider: script
script: docker push "${DOCKER_IMAGE_NAME}:${TRAVIS_BRANCH}"
on:
all_branches: true
- provider: releases
api_key: $GITHUB_OAUTH_TOKEN
file:
- "target/$TRAVIS_TAG.zip"
skip_cleanup: true
on:
tags: true
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'