-
Notifications
You must be signed in to change notification settings - Fork 7
/
.travis.yml
44 lines (40 loc) · 1.33 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
language: node_js
sudo: required
addons:
chrome: stable
node_js:
- 6
services:
- docker
cache:
directories:
- node_modules
env:
global:
- version=${TRAVIS_BUILD_NUMBER}
before_install:
- docker run --name mongodb -d mongo
- docker build --build-arg web_domain=${web_domain} --build-arg MONGODB_HOST=${MONGODB_HOST} --build-arg MONGODB_PORT=${MONGODB_PORT} --tag ${IMAGE_NAME_BACKEND} ./backend/
- docker build --build-arg SERVICE_HOST=movie-api --build-arg SERVICE_PORT=3000 -t ${IMAGE_NAME_WEBUI} ./webui/
- docker images
install:
- cd backend
- docker run --name movie-api --link ${MONGODB_HOST}:${MONGODB_PORT} -e "MONGODB_HOST=${MONGODB_HOST}" -e "MONGODB_PORT=${MONGODB_PORT}" -p 3000:3000 -d ${IMAGE_NAME_BACKEND}
- docker run --link movie-api --name movie-webui -p 80:80 -d ${IMAGE_NAME_WEBUI}
- docker ps
- npm install
- cd ../webui
- npm install
- cd ..
script: bash scripts/test.sh
before_deploy:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS"
- docker tag ${IMAGE_NAME_BACKEND} "${IMAGE_NAME_BACKEND}:latest"
- docker tag ${IMAGE_NAME_BACKEND} "${IMAGE_NAME_BACKEND}:${version}"
- docker tag ${IMAGE_NAME_WEBUI} "${IMAGE_NAME_WEBUI}:latest"
- docker tag ${IMAGE_NAME_WEBUI} "${IMAGE_NAME_WEBUI}:${version}"
deploy:
provider: script
script: bash scripts/deploy.sh
on:
branch: master