Browse Source

chore: add missing run script

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5444/head
Pranav C 2 years ago
parent
commit
ce8424d9cf
  1. 2
      packages/nocodb-nest/package.json
  2. 28
      packages/nocodb-nest/src/run/docker.ts
  3. 34
      packages/nocodb-nest/src/run/dockerRunMysql.ts
  4. 34
      packages/nocodb-nest/src/run/dockerRunPG.ts
  5. 27
      packages/nocodb-nest/src/run/dockerRunPG_CyQuick.ts

2
packages/nocodb-nest/package.json

@ -19,6 +19,8 @@
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"watch:run:playwright": "rm -f ./test_noco.db; cross-env DATABASE_URL=sqlite:./test_noco.db PLAYWRIGHT_TEST=true NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/run/testDocker --log-error --project tsconfig.json\"",
"watch:run:playwright:quick": "rm -f ./test_noco.db; cp ../../tests/playwright/fixtures/noco_0_91_7.db ./test_noco.db; cross-env DATABASE_URL=sqlite:./test_noco.db NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/run/docker --log-error --project tsconfig.json\"",
"watch:run:playwright:pg:cyquick": "rm -f ./test_noco.db; cp ../../tests/playwright/fixtures/noco_0_91_7.db ./test_noco.db; cross-env NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/run/dockerRunPG_CyQuick.ts --log-error --project tsconfig.json\"",
"test:unit": "cross-env TS_NODE_PROJECT=./tests/unit/tsconfig.json mocha -r ts-node/register tests/unit/index.test.ts --recursive --timeout 300000 --exit --delay",
"test:unit:pg": "cp tests/unit/.pg.env tests/unit/.env; cross-env TS_NODE_PROJECT=./tests/unit/tsconfig.json mocha -r ts-node/register tests/unit/index.test.ts --recursive --timeout 300000 --exit --delay"
},

28
packages/nocodb-nest/src/run/docker.ts

@ -0,0 +1,28 @@
import axios from 'axios'
import cors from 'cors';
import express from 'express';
import Noco from '../lib/Noco';
import { User } from '../models'
import nocobuild from '../nocobuild'
const server = express();
server.enable('trust proxy');
server.disable('etag');
server.disable('x-powered-by');
server.use(
cors({
exposedHeaders: 'xc-db-response',
})
);
server.set('view engine', 'ejs');
process.env[`DEBUG`] = 'xc*';
(async () => {
await nocobuild(server);
const httpServer = server.listen(process.env.PORT || 8080, async () => {
console.log('Server started')
});
})().catch((e) => console.log(e));

34
packages/nocodb-nest/src/run/dockerRunMysql.ts

@ -0,0 +1,34 @@
import cors from 'cors';
import express from 'express';
import nocobuild from '../nocobuild'
const server = express();
server.enable('trust proxy');
server.disable('etag');
server.disable('x-powered-by');
server.use(
cors({
exposedHeaders: 'xc-db-response',
})
);
server.set('view engine', 'ejs');
const date = new Date();
const metaDb = `meta_v2_${date.getFullYear()}_${(date.getMonth() + 1)
.toString()
.padStart(2, '0')}_${date.getDate().toString().padStart(2, '0')}`;
process.env[`NC_DB`] = `mysql2://localhost:3306?u=root&p=password&d=${metaDb}`;
// process.env[`NC_DB`] = `pg:/2/localhost:3306?u=root&p=password&d=mar_24`;
// process.env[`NC_DB`] = `pg://localhost:5432?u=postgres&p=password&d=abcde`;
// process.env[`NC_TRY`] = 'true';
// process.env[`NC_DASHBOARD_URL`] = '/test';
// process.env[`DEBUG`] = 'xc*';
(async () => {
await nocobuild(server);
const httpServer = server.listen(process.env.PORT || 8080, async () => {
console.log('Server started')
});
})().catch((e) => console.log(e));

34
packages/nocodb-nest/src/run/dockerRunPG.ts

@ -0,0 +1,34 @@
import cors from 'cors';
import express from 'express';
import nocobuild from '../nocobuild'
const server = express();
server.enable('trust proxy');
server.disable('etag');
server.disable('x-powered-by');
server.use(
cors({
exposedHeaders: 'xc-db-response',
})
);
server.set('view engine', 'ejs');
const date = new Date();
const metaDb = `meta_v2_${date.getFullYear()}_${(date.getMonth() + 1)
.toString()
.padStart(2, '0')}_${date.getDate().toString().padStart(2, '0')}`;
// process.env[`NC_DB`] = `mysql2://localhost:3306?u=root&p=password&d=${metaDb}`;
// process.env[`NC_DB`] = `pg:/2/localhost:3306?u=root&p=password&d=mar_24`;
process.env[`NC_DB`] = `pg://localhost:5432?u=postgres&p=password&d=${metaDb}`;
// process.env[`NC_TRY`] = 'true';
// process.env[`NC_DASHBOARD_URL`] = '/test';
// process.env[`DEBUG`] = 'xc*';
(async () => {
await nocobuild(server);
const httpServer = server.listen(process.env.PORT || 8080, async () => {
console.log('Server started')
});
})().catch((e) => console.log(e));

27
packages/nocodb-nest/src/run/dockerRunPG_CyQuick.ts

@ -0,0 +1,27 @@
import cors from 'cors';
import express from 'express';
import nocobuild from '../nocobuild'
const server = express();
server.enable('trust proxy');
server.disable('etag');
server.disable('x-powered-by');
server.use(
cors({
exposedHeaders: 'xc-db-response',
})
);
server.set('view engine', 'ejs');
process.env[
`NC_DB`
] = `pg://localhost:5432?u=postgres&p=password&d=meta_v2_2022_06_13`;
//process.env[`DEBUG`] = 'xc*';
(async () => {
await nocobuild(server);
const httpServer = server.listen(process.env.PORT || 8080, async () => {
console.log('Server started')
});
})().catch((e) => console.log(e));
Loading…
Cancel
Save