-
Notifications
You must be signed in to change notification settings - Fork 28
/
.travis.yml
36 lines (28 loc) · 1.32 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
sudo: required
language: node_js
node_js:
- lts/*
services:
- docker
env:
- NODE_ENV=test
install:
- npm install -g codecov
before_install:
- mv ./config/default.sample.js ./config/default.js
- cat ./config/test.sample.js | sed -e "s|your-sentry-dsn|"$SENTRY_DSN"|" -e "s|your-redis-url|"$REDIS_URL"|" -e "s|your-mongodb-url|"$MONGODB_URL"|" > ./config/test.js # Set correct Sentry dns and Redis and Mongo DB url
- docker build -t server-express-test -f ./Dockerfile.dev .
script:
- docker run --env NODE_ENV=test server-express-test npm run test:unit
- docker run --env NODE_ENV=test server-express-test npm run test:int
- docker run --env NODE_ENV=test -v "$PWD/shared:/usr/src/app/coverage" server-express-test npm run coverage
after_success:
- bash <(curl -s https://codecov.io/bash)
- docker build -t server-express .
- docker build -t server-express-nginx ./nginx
### Uncomment to push images to docker hub. Required settings up env vars with Docker hub username and password ###
# - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# - docker tag server-express $DOCKER_USERNAME/server-express
# - docker tag server-express-nginx $DOCKER_USERNAME/server-express-nginx
# - docker push $DOCKER_USERNAME/server-express
# - docker push $DOCKER_USERNAME/server-express-nginx