Compare commits

..

No commits in common. "master" and "v1.2.28" have entirely different histories.

22 changed files with 1413 additions and 27469 deletions

27
.gitignore vendored
View File

@ -1,23 +1,8 @@
.nogit/
# artifacts
coverage/
public/
pages/
# installs
node_modules/
coverage/
pages/
public/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_web/
dist_serve/
dist_ts_web/
# custom
test
test/
assets/
.nogit/

View File

@ -57,8 +57,8 @@ pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
script:
- npmci command npm install -g @gitzone/tsdoc
- npmci command tsdoc
- npmci command yarn global add npmpage
- npmci command npmpage
only:
- tags
tags:

View File

@ -1,3 +0,0 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}

67
README.md Normal file
View File

@ -0,0 +1,67 @@
# npmdocker
develop npm modules cross platform with docker
## Availabililty
[![npm](https://gitzone.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/npmdocker)
[![git](https://gitzone.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/gitzone/npmdocker)
[![git](https://gitzone.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/gitzone/npmdocker)
[![docs](https://gitzone.gitlab.io/assets/repo-button-docs.svg)](https://gitzone.gitlab.io/npmdocker/)
## Status for master
[![build status](https://GitLab.com/gitzone/npmdocker/badges/master/build.svg)](https://GitLab.com/gitzone/npmdocker/commits/master)
[![coverage report](https://GitLab.com/gitzone/npmdocker/badges/master/coverage.svg)](https://GitLab.com/gitzone/npmdocker/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/npmdocker.svg)](https://www.npmjs.com/package/npmdocker)
[![Dependency Status](https://david-dm.org/gitzonetools/npmdocker.svg)](https://david-dm.org/gitzonetools/npmdocker)
[![bitHound Dependencies](https://www.bithound.io/github/gitzonetools/npmdocker/badges/dependencies.svg)](https://www.bithound.io/github/gitzonetools/npmdocker/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/gitzonetools/npmdocker/badges/code.svg)](https://www.bithound.io/github/gitzonetools/npmdocker)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
### Why does this package exist?
Sometimes you want a clean and fresh linux environment everytime you test your package.
Usually this is the default i CI, but locally behaviour tends to defer.
### Where does it work
The npmdocker package works in everywhere where the docker cli is available. e.g.:
* docker toolbox
* native docker application
* docker in docker
* mounted docker.sock
### How do I use it?
create a npmextra.json in the project's root directory
```json
{
"npmdocker": {
"baseImage": "hosttoday/ht-docker-node:npmts",
"command": "npmci test stable",
"dockerSock": false
}
}
```
| option | description |
| ----------- | ------------------------------------------------------------------------------------- |
| baseImage | the base image that is the context for your project |
| command | the cli command to run within the the project's directory inside the docker container |
| dockersSock | wether or not the testcontainer will have access to the docker.sock of the host |
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://gitzone.gitlab.io/assets/repo-footer.svg)](https://git.zone)

View File

@ -1,6 +1,6 @@
FROM hosttoday/ht-docker-node:npmci
RUN yarn global add @gitzone/tsdocker
RUN yarn global add npmdocker
COPY ./ /workspace
WORKDIR /workspace
ENV CI=true
CMD ["tsdocker","runinside"];
CMD ["npmdocker","runinside"];

1
docs/index.md Normal file
View File

@ -0,0 +1 @@
Docs for npmpage coming soon.

View File

@ -6,15 +6,5 @@
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
},
"gitzone": {
"module": {
"githost": "gitlab.com",
"gitscope": "gitzone",
"gitrepo": "npmdocker",
"shortDescription": "develop npm modules cross platform with docker",
"npmPackagename": "@gitzone/npmdocker",
"license": "MIT"
}
}
}

28342
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,12 @@
{
"name": "@gitzone/tsdocker",
"version": "1.2.40",
"name": "@gitzone/npmdocker",
"version": "1.2.28",
"private": false,
"description": "develop npm modules cross platform with docker",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"bin": {
"tsdocker": "cli.js"
"npmdocker": "cli.js"
},
"scripts": {
"test": "(npm run clean && npm run setupCheck && npm run testStandard && npm run testSpeed)",
@ -14,7 +14,6 @@
"testStandard": "(cd test/ && node ../cli.ts.js)",
"testSpeed": "(cd test/ && node ../cli.ts.js speedtest)",
"testClean": "(cd test/ && node ../cli.ts.js clean --all)",
"testVscode": "(cd test/ && node ../cli.ts.js vscode)",
"clean": "(rm -rf test/)",
"compile": "(npmts --notest)",
"setupCheck": "(git clone https://gitlab.com/sandboxzone/sandbox-npmts.git test/)"
@ -33,28 +32,24 @@
},
"homepage": "https://gitlab.com/gitzone/npmdocker#README",
"devDependencies": {
"@gitzone/tsbuild": "^2.1.27",
"@gitzone/tsrun": "^1.2.17",
"@gitzone/tstest": "^1.0.57",
"@pushrocks/tapbundle": "^3.2.14",
"@types/node": "^16.10.1",
"tslint": "^6.1.3",
"@gitzone/tsbuild": "^2.1.11",
"@gitzone/tsrun": "^1.2.6",
"@gitzone/tstest": "^1.0.20",
"@pushrocks/tapbundle": "^3.0.9",
"@types/node": "^12.0.0",
"tslint": "^5.16.0",
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@pushrocks/npmextra": "^3.0.9",
"@pushrocks/projectinfo": "^4.0.5",
"@pushrocks/qenv": "^4.0.10",
"@pushrocks/npmextra": "^3.0.1",
"@pushrocks/projectinfo": "^4.0.2",
"@pushrocks/qenv": "^4.0.0",
"@pushrocks/smartanalytics": "^2.0.15",
"@pushrocks/smartcli": "^3.0.14",
"@pushrocks/smartfile": "^8.0.10",
"@pushrocks/smartlog": "^2.0.44",
"@pushrocks/smartlog-destination-local": "^8.0.8",
"@pushrocks/smartlog-source-ora": "^1.0.9",
"@pushrocks/smartopen": "^1.0.22",
"@pushrocks/smartpromise": "^3.1.6",
"@pushrocks/smartshell": "^2.0.28",
"@pushrocks/smartstring": "^3.0.24",
"@types/shelljs": "^0.8.9"
"@pushrocks/smartcli": "^3.0.7",
"@pushrocks/smartfile": "^7.0.2",
"@pushrocks/smartpromise": "^3.0.2",
"@pushrocks/smartshell": "^2.0.13",
"@pushrocks/smartstring": "^3.0.10",
"@types/shelljs": "^0.8.5"
}
}

20
ts/analytics.ts Normal file
View File

@ -0,0 +1,20 @@
/**
* smartanalytics:
* We count executions of this tool to keep track which of our tools are really used.
* This insight is used to plan spending our limited resources for improving them.
* Any submitted analytics data is fully anonymized (no Ips or any other personal information is tracked).
* Feel free to dig into the smartanalytics package, if you are interested in how it works.
* Our privacy policy can be found here: https://lossless.gmbh/privacy.html
* The privacy policy is also linked in the readme, so we hope this behaviour does not come as a surprise to you.
* Have a nice day and regards
* Your Open Source team at Lossless GmbH :)
*/
import * as smartanalytics from '@pushrocks/smartanalytics';
const npmdockerAnalytics = new smartanalytics.Analytics({
apiEndPoint: 'https://pubapi.lossless.one',
appName: 'npmdocker',
projectId: 'gitzone'
});
npmdockerAnalytics.recordEvent('npmtoolexecution', {
somedata: 'somedata'
});

View File

@ -1,4 +1,5 @@
import * as plugins from './tsdocker.plugins';
import * as cli from './tsdocker.cli';
import './analytics';
import * as plugins from './npmdocker.plugins';
import * as cli from './npmdocker.cli';
cli.run();

75
ts/npmdocker.cli.ts Normal file
View File

@ -0,0 +1,75 @@
import * as plugins from './npmdocker.plugins';
import * as paths from './npmdocker.paths';
// modules
import * as ConfigModule from './npmdocker.config';
import * as DockerModule from './npmdocker.docker';
let npmdockerCli = new plugins.smartcli.Smartcli();
export let run = () => {
npmdockerCli.standardTask().subscribe(async argvArg => {
let configArg = await ConfigModule.run().then(DockerModule.run);
if (configArg.exitCode === 0) {
plugins.beautylog.success('container ended all right!');
} else {
plugins.beautylog.error(`container ended with error! Exit Code is ${configArg.exitCode}`);
process.exit(1);
}
});
/**
* this command is executed inside docker and meant for use from outside docker
*/
npmdockerCli.addCommand('runinside').subscribe(async argvArg => {
plugins.beautylog.ok('Allright. We are now in Docker!');
plugins.beautylog.log('now trying to run your specified command');
let configArg = await ConfigModule.run();
const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash'
});
await smartshellInstance.exec(configArg.command).then(response => {
if (response.exitCode !== 0) {
process.exit(1);
}
});
});
npmdockerCli.addCommand('clean').subscribe(async argvArg => {
plugins.beautylog.ora.start();
plugins.beautylog.ora.text('cleaning up docker env...');
if (argvArg.all) {
const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash'
});
plugins.beautylog.ora.text('killing any running docker containers...');
await smartshellInstance.exec(`docker kill $(docker ps -q)`);
plugins.beautylog.ora.text('removing stopped containers...');
await smartshellInstance.exec(`docker rm $(docker ps -a -q)`);
plugins.beautylog.ora.text('removing images...');
await smartshellInstance.exec(`docker rmi -f $(docker images -q -f dangling=true)`);
plugins.beautylog.ora.text('removing all other images...');
await smartshellInstance.exec(`docker rmi $(docker images -a -q)`);
plugins.beautylog.ora.text('removing all volumes...');
await smartshellInstance.exec(`docker volume rm $(docker volume ls -f dangling=true -q)`);
}
plugins.beautylog.ora.endOk('docker environment now is clean!');
});
npmdockerCli.addCommand('speedtest').subscribe(async argvArg => {
const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash'
});
plugins.beautylog.figletSync('npmdocker');
plugins.beautylog.ok('Starting speedtest');
await smartshellInstance.exec(
`docker pull tianon/speedtest && docker run --rm tianon/speedtest`
);
});
npmdockerCli.startParse();
};

40
ts/npmdocker.config.ts Normal file
View File

@ -0,0 +1,40 @@
import * as plugins from './npmdocker.plugins';
import * as paths from './npmdocker.paths';
// interfaces
import { IKeyValueObject } from '@pushrocks/qenv';
export interface IConfig {
baseImage: string;
command: string;
dockerSock: boolean;
exitCode?: number;
keyValueObjectArray: IKeyValueObject[];
}
let getQenvKeyValueObject = async () => {
let qenvKeyValueObjectArray: IKeyValueObject[];
if (plugins.smartfile.fs.fileExistsSync(plugins.path.join(paths.cwd, 'qenv.yml'))) {
qenvKeyValueObjectArray = new plugins.qenv.Qenv(paths.cwd, '.nogit/').keyValueObjectArray;
} else {
qenvKeyValueObjectArray = [];
}
return qenvKeyValueObjectArray;
};
let buildConfig = async (qenvKeyValueObjectArrayArg: IKeyValueObject[]) => {
let npmextra = new plugins.npmextra.Npmextra(paths.cwd);
let config = npmextra.dataFor<IConfig>('npmdocker', {
baseImage: 'hosttoday/ht-docker-node:npmdocker',
init: 'rm -rf node_nodules/ && yarn install',
command: 'npmci npm test',
dockerSock: false,
keyValueObjectArray: qenvKeyValueObjectArrayArg
});
return config;
};
export let run = async (): Promise<IConfig> => {
let config = await getQenvKeyValueObject().then(buildConfig);
return config;
};

View File

@ -1,22 +1,20 @@
import * as plugins from './tsdocker.plugins';
import * as paths from './tsdocker.paths';
import * as snippets from './tsdocker.snippets';
import { logger, ora } from './tsdocker.logging';
import * as plugins from './npmdocker.plugins';
import * as paths from './npmdocker.paths';
import * as snippets from './npmdocker.snippets';
const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash'
});
// interfaces
import { IConfig } from './tsdocker.config';
import { IConfig } from './npmdocker.config';
let config: IConfig;
/**
* the docker data used to build the internal testing container
*/
const dockerData = {
let dockerData = {
imageTag: 'npmdocker-temp-image:latest',
containerName: 'npmdocker-temp-container',
dockerProjectMountString: '',
@ -27,12 +25,12 @@ const dockerData = {
/**
* check if docker is available
*/
const checkDocker = () => {
const done = plugins.smartpromise.defer();
ora.text('checking docker...');
let checkDocker = () => {
let done = plugins.smartpromise.defer();
plugins.beautylog.ora.text('checking docker...');
if (smartshellInstance.exec('which docker')) {
logger.log('ok', 'Docker found!');
plugins.beautylog.ok('Docker found!');
done.resolve();
} else {
done.reject(new Error('docker not found on this machine'));
@ -43,18 +41,18 @@ const checkDocker = () => {
/**
* builds the Dockerfile according to the config in the project
*/
const buildDockerFile = () => {
const done = plugins.smartpromise.defer();
ora.text('building Dockerfile...');
const dockerfile: string = snippets.dockerfileSnippet({
let buildDockerFile = () => {
let done = plugins.smartpromise.defer();
plugins.beautylog.ora.text('building Dockerfile...');
let dockerfile: string = snippets.dockerfileSnippet({
baseImage: config.baseImage,
command: config.command
});
logger.log('info', `Base image is: ${config.baseImage}`);
logger.log('info', `Command is: ${config.command}`);
plugins.beautylog.info(`Base image is: ${config.baseImage}`);
plugins.beautylog.info(`Command is: ${config.command}`);
plugins.smartfile.memory.toFsSync(dockerfile, plugins.path.join(paths.cwd, 'npmdocker'));
logger.log('ok', 'Dockerfile created!');
ora.stop();
plugins.beautylog.ok('Dockerfile created!');
plugins.beautylog.ora.stop();
done.resolve();
return done.promise;
};
@ -62,18 +60,18 @@ const buildDockerFile = () => {
/**
* builds the Dockerimage from the built Dockerfile
*/
const buildDockerImage = async () => {
logger.log('info', 'pulling latest base image from registry...');
let buildDockerImage = async () => {
plugins.beautylog.info('pulling latest base image from registry...');
await smartshellInstance.exec(`docker pull ${config.baseImage}`);
ora.text('building Dockerimage...');
const execResult = await smartshellInstance.execSilent(
plugins.beautylog.ora.text('building Dockerimage...');
let execResult = await smartshellInstance.execSilent(
`docker build -f npmdocker -t ${dockerData.imageTag} ${paths.cwd}`
);
if (execResult.exitCode !== 0) {
console.log(execResult.stdout);
process.exit(1);
}
logger.log('ok', 'Dockerimage built!');
plugins.beautylog.ok('Dockerimage built!');
};
const buildDockerProjectMountString = async () => {
@ -86,9 +84,9 @@ const buildDockerProjectMountString = async () => {
* builds an environment string that docker cli understands
*/
const buildDockerEnvString = async () => {
for (const key of Object.keys(config.keyValueObject)) {
const envString = (dockerData.dockerEnvString =
dockerData.dockerEnvString + `-e ${key}=${config.keyValueObject[key]} `);
for (let keyValueObjectArg of config.keyValueObjectArray) {
let envString = (dockerData.dockerEnvString =
dockerData.dockerEnvString + `-e ${keyValueObjectArg.key}=${keyValueObjectArg.value} `);
}
};
@ -104,11 +102,11 @@ const buildDockerSockString = async () => {
/**
* creates a container by running the built Dockerimage
*/
const runDockerImage = async () => {
const done = plugins.smartpromise.defer();
ora.text('starting Container...');
ora.stop();
logger.log('info', 'now running Dockerimage');
let runDockerImage = async () => {
let done = plugins.smartpromise.defer();
plugins.beautylog.ora.text('starting Container...');
plugins.beautylog.ora.end();
plugins.beautylog.log('now running Dockerimage');
config.exitCode = (await smartshellInstance.exec(
`docker run ${dockerData.dockerProjectMountString} ${dockerData.dockerSockString} ${
dockerData.dockerEnvString
@ -119,14 +117,14 @@ const runDockerImage = async () => {
/**
* cleans up: deletes the test container
*/
const deleteDockerContainer = async () => {
let deleteDockerContainer = async () => {
await smartshellInstance.execSilent(`docker rm -f ${dockerData.containerName}`);
};
/**
* cleans up deletes the test image
*/
const deleteDockerImage = async () => {
let deleteDockerImage = async () => {
await smartshellInstance.execSilent(`docker rmi ${dockerData.imageTag}`).then(async response => {
if (response.exitCode !== 0) {
console.log(response.stdout);
@ -134,26 +132,27 @@ const deleteDockerImage = async () => {
});
};
const preClean = async () => {
let preClean = async () => {
await deleteDockerImage()
.then(deleteDockerContainer)
.then(async () => {
logger.log('ok', 'ensured clean Docker environment!');
plugins.beautylog.ok('ensured clean Docker environment!');
});
};
const postClean = async () => {
let postClean = async () => {
await deleteDockerContainer()
.then(deleteDockerImage)
.then(async () => {
logger.log('ok', 'cleaned up!');
plugins.beautylog.ok('cleaned up!');
});
plugins.smartfile.fs.removeSync(paths.npmdockerFile);
};
export let run = async (configArg: IConfig): Promise<IConfig> => {
plugins.beautylog.ora.start();
config = configArg;
const resultConfig = await checkDocker()
let resultConfig = await checkDocker()
.then(preClean)
.then(buildDockerFile)
.then(buildDockerImage)

0
ts/npmdocker.logging.ts Normal file
View File

View File

@ -1,4 +1,4 @@
import * as plugins from './tsdocker.plugins';
import * as plugins from './npmdocker.plugins';
// directories
export let cwd = process.cwd();

View File

@ -1,4 +1,4 @@
// pushrocks scope
import * as beautylog from 'beautylog';
import * as npmextra from '@pushrocks/npmextra';
import * as path from 'path';
import * as projectinfo from '@pushrocks/projectinfo';
@ -6,14 +6,11 @@ import * as smartpromise from '@pushrocks/smartpromise';
import * as qenv from '@pushrocks/qenv';
import * as smartcli from '@pushrocks/smartcli';
import * as smartfile from '@pushrocks/smartfile';
import * as smartlog from '@pushrocks/smartlog';
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
import * as smartlogSouceOra from '@pushrocks/smartlog-source-ora';
import * as smartopen from '@pushrocks/smartopen';
import * as smartshell from '@pushrocks/smartshell';
import * as smartstring from '@pushrocks/smartstring';
export {
beautylog,
npmextra,
path,
projectinfo,
@ -21,10 +18,6 @@ export {
qenv,
smartcli,
smartfile,
smartlog,
smartlogDestinationLocal,
smartlogSouceOra,
smartopen,
smartshell,
smartstring
};

View File

@ -1,4 +1,4 @@
import * as plugins from './tsdocker.plugins';
import * as plugins from './npmdocker.plugins';
export interface IDockerfileSnippet {
baseImage: string;

View File

@ -1,90 +0,0 @@
import * as plugins from './tsdocker.plugins';
import * as paths from './tsdocker.paths';
// modules
import * as ConfigModule from './tsdocker.config';
import * as DockerModule from './tsdocker.docker';
import { logger, ora } from './tsdocker.logging';
const tsdockerCli = new plugins.smartcli.Smartcli();
export let run = () => {
tsdockerCli.standardTask().subscribe(async argvArg => {
const configArg = await ConfigModule.run().then(DockerModule.run);
if (configArg.exitCode === 0) {
logger.log('success', 'container ended all right!');
} else {
logger.log('error', `container ended with error! Exit Code is ${configArg.exitCode}`);
process.exit(1);
}
});
/**
* this command is executed inside docker and meant for use from outside docker
*/
tsdockerCli.addCommand('runinside').subscribe(async argvArg => {
logger.log('ok', 'Allright. We are now in Docker!');
ora.text('now trying to run your specified command');
const configArg = await ConfigModule.run();
const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash'
});
ora.stop();
await smartshellInstance.exec(configArg.command).then(response => {
if (response.exitCode !== 0) {
process.exit(1);
}
});
});
tsdockerCli.addCommand('clean').subscribe(async argvArg => {
ora.text('cleaning up docker env...');
if (argvArg.all) {
const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash'
});
ora.text('killing any running docker containers...');
await smartshellInstance.exec(`docker kill $(docker ps -q)`);
ora.text('removing stopped containers...');
await smartshellInstance.exec(`docker rm $(docker ps -a -q)`);
ora.text('removing images...');
await smartshellInstance.exec(`docker rmi -f $(docker images -q -f dangling=true)`);
ora.text('removing all other images...');
await smartshellInstance.exec(`docker rmi $(docker images -a -q)`);
ora.text('removing all volumes...');
await smartshellInstance.exec(`docker volume rm $(docker volume ls -f dangling=true -q)`);
}
ora.finishSuccess('docker environment now is clean!');
});
tsdockerCli.addCommand('speedtest').subscribe(async argvArg => {
const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash'
});
logger.log('ok', 'Starting speedtest');
await smartshellInstance.exec(
`docker pull tianon/speedtest && docker run --rm tianon/speedtest --accept-license --accept-gdpr`
);
});
tsdockerCli.addCommand('vscode').subscribe(async argvArg => {
const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash'
});
logger.log('ok', `Starting vscode in cwd ${paths.cwd}`);
await smartshellInstance.execAndWaitForLine(
`docker run -p 127.0.0.1:8443:8443 -v "${
paths.cwd
}:/home/coder/project" registry.gitlab.com/hosttoday/ht-docker-vscode --allow-http --no-auth`,
/Connected to shared process/
);
await plugins.smartopen.openUrl('testing-vscode.git.zone:8443');
});
tsdockerCli.startParse();
};

View File

@ -1,37 +0,0 @@
import * as plugins from './tsdocker.plugins';
import * as paths from './tsdocker.paths';
export interface IConfig {
baseImage: string;
command: string;
dockerSock: boolean;
exitCode?: number;
keyValueObject: {[key: string]: any};
}
const getQenvKeyValueObject = async () => {
let qenvKeyValueObjectArray: { [key: string]: string | number };
if (plugins.smartfile.fs.fileExistsSync(plugins.path.join(paths.cwd, 'qenv.yml'))) {
qenvKeyValueObjectArray = new plugins.qenv.Qenv(paths.cwd, '.nogit/').keyValueObject;
} else {
qenvKeyValueObjectArray = {};
}
return qenvKeyValueObjectArray;
};
const buildConfig = async (qenvKeyValueObjectArg: { [key: string]: string | number }) => {
const npmextra = new plugins.npmextra.Npmextra(paths.cwd);
const config = npmextra.dataFor<IConfig>('npmdocker', {
baseImage: 'hosttoday/ht-docker-node:npmdocker',
init: 'rm -rf node_nodules/ && yarn install',
command: 'npmci npm test',
dockerSock: false,
keyValueObject: qenvKeyValueObjectArg
});
return config;
};
export let run = async (): Promise<IConfig> => {
const config = await getQenvKeyValueObject().then(buildConfig);
return config;
};

View File

@ -1,17 +0,0 @@
import * as plugins from './tsdocker.plugins';
export const logger = new plugins.smartlog.Smartlog({
logContext: {
company: 'Some Company',
companyunit: 'Some CompanyUnit',
containerName: 'Some Containername',
environment: 'local',
runtime: 'node',
zone: 'gitzone'
},
minimumLogLevel: 'silly'
});
logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());
export const ora = new plugins.smartlogSouceOra.SmartlogSourceOra();

View File

@ -4,14 +4,7 @@
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
"object-literal-sort-keys": false
},
"defaultSeverity": "warning"
}