diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..30ec9a7 --- /dev/null +++ b/.gitlab-ci.yml @@ -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 \ No newline at end of file diff --git a/test/config-ci.json b/test/config-ci.json new file mode 100644 index 0000000..f997bc7 --- /dev/null +++ b/test/config-ci.json @@ -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" + } + } +} \ No newline at end of file diff --git a/test/docker_install.sh b/test/docker_install.sh new file mode 100644 index 0000000..9f10f9c --- /dev/null +++ b/test/docker_install.sh @@ -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" \ No newline at end of file