-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
34 lines (31 loc) · 1.1 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
language: node_js
node_js: 12
env:
global:
- JARDI_TEST_MONGO_URI="mongodb://127.0.0.1:27017/test-jardin?retryWrites=true&w=majority"
- JARDI_TEST_ADMIN_MONGO_DB_NAME=test-jardinAdmin
- JARDI_TEST_USER_MONGO_URI="mongodb://jojo:papa@127.0.0.1:27017/test-jardin?retryWrites=true&w=majority"
stages:
- test
- deploy
jobs:
include:
- stage: test
services:
- mongodb
before_script:
# https://docs.travis-ci.com/user/database-setup/#mongodb
- sleep 15
- mongo test-jardin --eval 'db.createUser({user:"root",pwd:"mypass",roles:["readWrite"]});'
- mongo test-jardinAdmin --eval 'db.createUser({user:"root",pwd:"mypass",roles:["readWrite"]});'
- mongo test-jardin --eval 'db.createUser({user:"jojo",pwd:"papa",roles:["read"]});'
script: npm run cover
- stage: deploy
if: (tag =~ ^v)
script:
- echo "//registry.npmjs.org/:_authToken=\${NPM_DEPLOY_TOKEN}" > .npmrc
- npm whoami # rely on .npmrc
- npm publish
on:
tags: true
branch: master