-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.travis.yml
23 lines (20 loc) · 1008 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
language: node_js
node_js:
- "node"
services:
- docker
before_install:
- mkdir -p manager2/dist
- npm install
- npm install -g eslint
script:
- eslint routes
- eslint core
- npm install -g mocha
- docker build -t osallou/my .
- cd $TRAVIS_BUILD_DIR/cron && docker build -f Dockerfile-cron -t osallou/mycron .
- cd $TRAVIS_BUILD_DIR/tests && docker-compose up -d
- cd $TRAVIS_BUILD_DIR/tests && for i in {10..0}; do echo Try $i; sleep 30; docker-compose logs my-app | grep "Server listening on port 3000"; if [ $? -eq 0 ] ; then echo Server is started; nb_done=$(docker-compose exec my-app ls -l /opt/my/scripts/ | grep admin | grep 'update.done' | wc -l); if [ $nb_done -eq 2 ] ; then echo Admin user created; break; fi; fi; if [ $i -eq 0 ]; then echo Server does not start; exit 1; fi; done
- cd $TRAVIS_BUILD_DIR && docker ps && mocha -b -t 20000 --full-trace
- cd $TRAVIS_BUILD_DIR/tests && docker-compose logs my-app
- cd $TRAVIS_BUILD_DIR/tests && docker-compose down