Set up initial config for gitlab ci

This commit is contained in:
Timothy Warren 2016-07-20 14:59:25 -04:00
parent e7d4f64889
commit 189b02e60f
3 changed files with 85 additions and 0 deletions

38
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,38 @@
before_script:
# Install dependencies
- bash test/docker_install.sh > /dev/null
services:
- mysql:latest
- postgres:latest
variables:
MYSQL_ROOT_PASSWORD: foo-bar-baz
MYSQL_DATABASE: test
MYSQL_USER: test
MYSQL_PASSWORD: test
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: test
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
test:4:
image: node:4
script: npm run test
test:5:
image: node:5
script: npm run test
test:6:
image: node:6
script: npm run test
test:latest:
image: node:latest
script: npm run test

34
test/config-ci.json Normal file
View File

@ -0,0 +1,34 @@
{
"mysql2": {
"driver": "mysql",
"connection": {
"host": "mysql2",
"user": "test",
"password": "test",
"database": "test"
}
},
"pg": {
"driver": "pg",
"connection": "postgres://test:test@posgres/test"
},
"pg-object": {
"driver": "pg",
"connection": {
"database": "test"
}
},
"dblite": {
"driver": "sqlite",
"connection": ":memory:"
},
"node-firebird": {
"driver": "firebird",
"connection": {
"host": "127.0.0.1",
"database": "/../FB_TEST_DB.FDB",
"user": "SYSDBA",
"password": "masterkey"
}
}
}

13
test/docker_install.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# We need to install dependencies only for Docker
[[ ! -e /.dockerenv ]] && [[ ! -e /.dockerinit ]] && exit 0
# Where am I?
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
set -xe
# Replace test config with docker config file
rm "$DIR/config.json"
mv "$DIR/config-ci.json $DIR/config.json"