-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
38 lines (29 loc) · 1019 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
36
37
38
language: java
services:
- docker
- maven
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
script:
# Build front
- cd front
- npm install
- npm run build
# Run front tests
- npm run test-ci
# Copy new generated resources on back static
- cd ../back
- mkdir -p "src/main/resources/static/" && cp -r ../front/dist/front/* src/main/resources/static/
# Build back (create .jar and run tests)
- mvn package
# Build docker image
- if [ "$TRAVIS_BRANCH" = "master" ]; then mkdir -p "../docker/build/" && cp -r target/back-0.0.1-SNAPSHOT.jar ../docker/build/; fi
- if [ "$TRAVIS_BRANCH" = "master" ]; then cd ../docker; fi
- if [ "$TRAVIS_BRANCH" = "master" ]; then docker build -t "$DOCKER_USERNAME"/santatecla .; fi
# Push to Docker Hub
- if [ "$TRAVIS_BRANCH" = "master" ]; then docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; fi
- if [ "$TRAVIS_BRANCH" = "master" ]; then docker push "$DOCKER_USERNAME"/santatecla; fi