-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
62 lines (62 loc) · 2 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
language: java
jdk:
- oraclejdk8
install: true
env:
-HEROKU_API_KEY=$HEROKU_TOKEN
-TAG=test
services:
- docker
stages:
- name: test
- name: build
- name: docker_build
if: branch = develop OR branch = develop
- name: deploy
if: branch = master
jobs:
include:
- stage: test
script:
- cd backend/
- chmod +x mvnw
- mvn test
- stage: build
script:
- cd frontend
- npm i
- npm run build
- cd ../backend/
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- stage: docker_build
script:
- cd backend/
- mvn package
- docker build -t $DOCKER_USERNAME/spring-backend.be:$TAG .
- cd ../frontend
- npm install
- npm install @types/node --save-dev
- npm run build
- docker build -t $DOCKER_USERNAME/spring-backend.fe:$TAG .
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker push $DOCKER_USERNAME/spring-backend.be:$TAG
- docker push $DOCKER_USERNAME/spring-backend.fe:$TAG
- stage: deploy
script:
- curl https://cli-assets.heroku.com/install-standalone.sh | sh
- docker login --username=_ --password=$HEROKU_TOKEN registry.heroku.com
- cd backend/
- mvn package -DskipTests
- docker build -t registry.heroku.com/murmuring-earth-40583/web -f Dockerfile .
- cd ../frontend
- npm install
- npm install @types/node --save-dev
- npm run build
- docker build -t registry.heroku.com/innovativeproject-chatbot/web -f Dockerfile .
- docker push registry.heroku.com/murmuring-earth-40583/web
- docker push registry.heroku.com/innovativeproject-chatbot/web
- /usr/local/bin/heroku container:release web -a murmuring-earth-40583
- /usr/local/bin/heroku container:release web -a innovativeproject-chatbot
cache:
directories:
- $HOME/.m2