Connect to service mongo and redis in CI
This commit is contained in:
parent
fc40e0e3f5
commit
d5ad652dda
3 changed files with 7 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
image: node:6
|
image: node:6
|
||||||
services:
|
services:
|
||||||
- mongo
|
- mongo
|
||||||
|
- redis
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
|
@ -14,6 +15,10 @@ test:
|
||||||
- npm test
|
- npm test
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
variables:
|
||||||
|
MONGO_URL: "mongodb://mongo:27017/hostr"
|
||||||
|
REDIS_URL: "redis://redis:6379"
|
||||||
|
DEBUG: "hostr*"
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
key: "$CI_BUILD_REF_NAME"
|
key: "$CI_BUILD_REF_NAME"
|
||||||
|
|
3
test/fixtures/mongo-file.js
vendored
3
test/fixtures/mongo-file.js
vendored
|
@ -1,7 +1,6 @@
|
||||||
const MongoClient = require('mongodb').MongoClient;
|
const MongoClient = require('mongodb').MongoClient;
|
||||||
const url = 'mongodb://localhost:27017/hostr';
|
|
||||||
|
|
||||||
MongoClient.connect(url, function connect(err, db) {
|
MongoClient.connect(process.env.MONGO_URL, function connect(err, db) {
|
||||||
const collection = db.collection('files');
|
const collection = db.collection('files');
|
||||||
collection.createIndex({
|
collection.createIndex({
|
||||||
'owner': 1,
|
'owner': 1,
|
||||||
|
|
3
test/fixtures/mongo-user.js
vendored
3
test/fixtures/mongo-user.js
vendored
|
@ -1,7 +1,6 @@
|
||||||
const MongoClient = require('mongodb').MongoClient;
|
const MongoClient = require('mongodb').MongoClient;
|
||||||
const url = 'mongodb://localhost:27017/hostr';
|
|
||||||
|
|
||||||
MongoClient.connect(url, function connect(err, db) {
|
MongoClient.connect(process.env.MONGO_URL, function connect(err, db) {
|
||||||
const collection = db.collection('users');
|
const collection = db.collection('users');
|
||||||
collection.remove({
|
collection.remove({
|
||||||
'email': 'test@hostr.co',
|
'email': 'test@hostr.co',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue