forked from sap-labs-france/emobility-smart-charging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
82 lines (53 loc) · 2.03 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
dist: bionic
language: minimal
jdk:
- oraclejdk8
addons:
apt:
packages:
- maven # Required for building the java backend
services:
- docker # Enable docker push
node_js:
- "12"
git:
depth: 1
cache:
directories:
- "$HOME/.m2"
notifications:
email: false
# See Makefile for the contents of the commands
jobs:
include:
# Master branch acts as stable release
# Builds a docker image and pushes it to docker hub
- stage: prod
if: branch = master and type != pull_request
script:
# First, log in to Docker to be able to push
- echo "$TRAVIS_DOCKER_PASSWORD" | docker login -u "$TRAVIS_DOCKER_USER" --password-stdin
# Builds docker image, tags the docker image, pushes the docker image to docker hub
# Images are pushed to the sapemob organization
- make emobility-smart-charging-docker-push DOCKER_USER=sapemob
# Any other branch acts as bug fix / feature test
# Builds backend (via mvn), frontend (via npm) and docker image
- stage: dev
if: branch != master or type = pull_request
name: dev_withoutDocker
# Build backend and frontend (without Docker)
script:
# Build backend (test build without Docker)
- make emobility-smart-charging-build
# Build frontend (test build without Docker)
# Assumes mvn clean install was run for typescript file generation
# via mvn typescript-generator:generate
- nvm install 12.16.3
- nvm use node 12.16.3
- make emobility-smart-charging-build-frontend
# This "build" script is also in the dev stage but runs in parallel
# Build Docker (builds backend and frontend again within Docker)
- script:
- make emobility-smart-charging-docker-build
if: branch != master
name: dev_withDocker