CI builds for Oracle

This commit is contained in:
Kononnable 2018-04-23 22:41:46 +02:00
parent 0a83ee6370
commit 0e4845025f
7 changed files with 92 additions and 24 deletions

View File

@ -15,10 +15,24 @@ env:
MARIADB_Username=root MARIADB_Password=!Passw0rd MARIADB_Database=typeorm_mg MARIADB_SSL=0
MSSQL_Skip=0 MSSQL_Host=localhost MSSQL_Port=1433 MSSQL_Username=sa MSSQL_Password=!Passw0rd
MSSQL_Database=typeorm_mg MSSQL_SSL=0
ORACLE_Skip=0
ORACLE_Host=localhost
ORACLE_Port=1521
ORACLE_SSL=0
ORACLE_UsernameSys=sys
ORACLE_PasswordSys=Oradoc_db1
ORACLE_Database=orclpdb1.localdomain
ORACLE_Username=typeorm_mg
ORACLE_Password=Passw0rd
before_install:
- sudo service mysql stop
- sudo service postgresql stop
- if [ -z "$DOCKER_USERNAME" ]; then echo "DOCKER_USERNAME is unset"; else echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin; fi
- if [ -z "$DOCKER_USERNAME" ]; then mv docker-compose-without-login.yml docker-compose.yml; fi
- docker-compose up -d
- mkdir /opt/oracle
- if [ -n "$DOCKER_USERNAME" ]; then docker cp typeorm-mg-oracle-client:/usr/lib/oracle/12.2/client64/lib /opt/oracle/instantclient_12_2; fi
- export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2:$LD_LIBRARY_PATH
- npm install -g npm@5
- npm install -g greenkeeper-lockfile@1
before_script:
@ -26,6 +40,7 @@ before_script:
- typings install
- npm link typescript
- tsc
- sleep 180
after_script:
- greenkeeper-lockfile-upload
dd:

View File

@ -2,13 +2,5 @@ parsers:
javascript:
enable_partials: yes
comment:
layout: diff
layout: header
behavior: default
codecov:
notify:
require_ci_to_pass: no
coverage:
status:
project:
default:
threshold: 5%

View File

@ -0,0 +1,54 @@
version: '2'
services:
# mysql
mysql:
image: "mysql:5.7.19"
container_name: "typeorm-mg-mysql"
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: "!Passw0rd"
# mariadb
mariadb:
image: "mariadb:10.2.9"
container_name: "typeorm-mg-mariadb"
ports:
- "3307:3306"
environment:
MYSQL_ROOT_PASSWORD: "!Passw0rd"
# postgres
postgres:
image: "postgres:10.0"
container_name: "typeorm-mg-postgres"
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: "!Passw0rd"
# mssql
mssql:
image: "microsoft/mssql-server-linux:2017-CU4"
container_name: "typeorm-mg-mssql"
ports:
- "1433:1433"
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: "!Passw0rd"
# oracle
# oracle:
# image: "store/oracle/database-enterprise:12.2.0.1-slim"
# container_name: "typeorm-mg-oracle"
# ports:
# - "1521:1521"
# environment:
# DB_SID: "sys"
# SYS_PASSWORD: "ORCLCDB"
# oracle_client:
# image: "store/oracle/database-instantclient:12.2.0.1"
# container_name: "typeorm-mg-oracle-client"

View File

@ -39,11 +39,16 @@ services:
SA_PASSWORD: "!Passw0rd"
# oracle
# oracle:
# image: "store/oracle/database-enterprise:12.2.0.1-slim"
# container_name: "typeorm-mg-oracle"
# ports:
# - "1521:1521"
# environment:
# DB_SID: "sys"
# SYS_PASSWORD: "ORCLCDB"
oracle:
image: "store/oracle/database-enterprise:12.2.0.1-slim"
container_name: "typeorm-mg-oracle"
ports:
- "1521:1521"
environment:
DB_SID: "sys"
SYS_PASSWORD: "ORCLCDB"
oracle_client:
image: "store/oracle/database-instantclient:12.2.0.1"
container_name: "typeorm-mg-oracle-client"

View File

@ -17,14 +17,13 @@ gulp.task('compile', ['clean'], function () {
});
gulp.task('clean', function () {
return gulp.src(['dist','coverage','output'], { read: false })
return gulp.src(['dist', 'coverage', 'output'], { read: false })
.pipe(clean());
});
gulp.task('prettier', function () {
return gulp.src('.prettierrc')
.pipe(shell(['prettier ./src/**/*.ts --write']))
// .pipe(shell(['prettier ./test/**/*.ts --write']))
});
gulp.task('pre-commit', ['prettier'], function () {
@ -61,11 +60,14 @@ gulp.task('pre-test', function () {
gulp.task('test', ['pre-test'], function () {
return gulp.src(['dist/test/**/*.test.js'], { read: false })
.pipe(mocha())
.pipe(istanbul.writeReports())
});
gulp.task('test-coverage', ['test'], function () {
gulp.task('coveragePost', ['test'], function () {
return gulp.src(['dist/test/**/*.test.js'], { read: false })
.pipe(istanbul.writeReports())
});
gulp.task('coverageRemap', ['coveragePost'], function () {
var GulpStream = gulp.src('coverage/coverage-final.json')
.pipe(remapIstanbul())
.pipe(gulp.dest('coverage/remapped'));

View File

@ -6,7 +6,7 @@
"scripts": {
"setup": "npm install && typings install",
"start": " node ./dist/src/index.js",
"test": "gulp test-coverage",
"test": "gulp coverageRemap",
"compile": "gulp compile",
"precommit": "gulp pre-commit"
},

View File

@ -25,7 +25,7 @@ describe("TypeOrm examples", async function () {
if (process.env.MYSQL_Skip == '0') dbDrivers.push('mysql')
if (process.env.MARIADB_Skip == '0') dbDrivers.push('mariadb')
if (process.env.MSSQL_Skip == '0') dbDrivers.push('mssql')
if (process.env.Oracle_Skip == '0') dbDrivers.push('oracle')
if (process.env.ORACLE_Skip == '0') dbDrivers.push('oracle')
let examplesPathJS = path.resolve(process.cwd(), 'dist/test/integration/examples')
let examplesPathTS = path.resolve(process.cwd(), 'test/integration/examples')