-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
45 lines (37 loc) · 904 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
39
40
41
42
43
44
45
sudo: required
language: node_js
node_js:
- "node"
services:
- mysql
env:
global:
- REGISTRY_USER=cainwatson
- IMAGE_NAME=cainwatson/fiesta
- IMAGE_VERSION=$TRAVIS_COMMIT
matrix:
- PORT=3030 MYSQL_URI=mysql://root@localhost:3306/fiesta
cache:
directories:
- "server/node_modules"
- "client/node_modules"
before_install:
- mysql -u root -e "CREATE DATABASE IF NOT EXISTS fiesta;"
- cd server; npm ci; cd ../
- cd client; npm ci; cd ../
script:
- cd server && npm test
- cd ../
- cd client && npm test
- cd ../
before_deploy:
- echo "$REGISTRY_PASS" | docker login -u "$REGISTRY_USER" --password-stdin
- cd server
- docker build -t "$IMAGE_NAME" .
- cd docker/db
- docker build -t "${IMAGE_NAME}-db" .
deploy:
provider: script
script: docker push "${IMAGE_NAME}:latest" && docker push "${IMAGE_NAME}-db:latest"
on:
branch: master