-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
35 lines (29 loc) · 970 Bytes
/
.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
sudo: required
language: java
dist: bionic
jdk: openjdk8
env:
NOSY_EMAIL_IMAGE: nosy-email:2.4.1
addons:
sonarcloud:
organization: "notification-system"
token: $SONAR_TOKEN
script:
# JaCoCo is used to have code coverage, "-Pcoverage" activates the maven profile in the pom.xml
- ./mvnw clean install -B
- mvn clean verify sonar:sonar -Pcoverage
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- docker build -t oktayalizada/$NOSY_EMAIL_IMAGE .
- docker push oktayalizada/$NOSY_EMAIL_IMAGE
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
services:
- docker
after_success:
- export PATH=$PATH:$HOME/.local/bin
- pip install awscli
- eval $(aws ecr get-login --no-include-email --region eu-north-1)
- docker tag oktayalizada/$NOSY_EMAIL_IMAGE $AWS_ECR_ACCOUNT.dkr.ecr.eu-north-1.amazonaws.com/$NOSY_EMAIL_IMAGE
- docker push $AWS_ECR_ACCOUNT.dkr.ecr.eu-north-1.amazonaws.com/$NOSY_EMAIL_IMAGE