Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
889a3fdc5a | |||
565c002127 | |||
6fec1a00ea | |||
e1f2c28718 | |||
9efab07424 | |||
18d16feaa9 | |||
df09ff0f9b | |||
7b50ceb69f | |||
d1fd76e8d0 | |||
b71fa1bc36 |
@ -4,10 +4,7 @@
|
|||||||
"cli": true
|
"cli": true
|
||||||
},
|
},
|
||||||
"npmci": {
|
"npmci": {
|
||||||
"npmGlobalTools": [
|
"npmGlobalTools": [],
|
||||||
"@gitzone/npmts",
|
|
||||||
"ts-node"
|
|
||||||
],
|
|
||||||
"npmAccessLevel": "public"
|
"npmAccessLevel": "public"
|
||||||
}
|
}
|
||||||
}
|
}
|
1387
package-lock.json
generated
1387
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
37
package.json
37
package.json
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/npmdocker",
|
"name": "@gitzone/npmdocker",
|
||||||
"version": "1.2.23",
|
"version": "1.2.28",
|
||||||
|
"private": false,
|
||||||
"description": "develop npm modules cross platform with docker",
|
"description": "develop npm modules cross platform with docker",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
@ -9,7 +10,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(npm run clean && npm run setupCheck && npm run testStandard && npm run testSpeed)",
|
"test": "(npm run clean && npm run setupCheck && npm run testStandard && npm run testSpeed)",
|
||||||
"build": "tsbuild",
|
"build": "(tsbuild)",
|
||||||
"testStandard": "(cd test/ && node ../cli.ts.js)",
|
"testStandard": "(cd test/ && node ../cli.ts.js)",
|
||||||
"testSpeed": "(cd test/ && node ../cli.ts.js speedtest)",
|
"testSpeed": "(cd test/ && node ../cli.ts.js speedtest)",
|
||||||
"testClean": "(cd test/ && node ../cli.ts.js clean --all)",
|
"testClean": "(cd test/ && node ../cli.ts.js clean --all)",
|
||||||
@ -31,24 +32,24 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/gitzone/npmdocker#README",
|
"homepage": "https://gitlab.com/gitzone/npmdocker#README",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.0.22",
|
"@gitzone/tsbuild": "^2.1.11",
|
||||||
"@gitzone/tsrun": "^1.1.12",
|
"@gitzone/tsrun": "^1.2.6",
|
||||||
"@gitzone/tstest": "^1.0.15",
|
"@gitzone/tstest": "^1.0.20",
|
||||||
"@pushrocks/tapbundle": "^3.0.7",
|
"@pushrocks/tapbundle": "^3.0.9",
|
||||||
"@types/node": "^10.9.4"
|
"@types/node": "^12.0.0",
|
||||||
|
"tslint": "^5.16.0",
|
||||||
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/npmextra": "^3.0.1",
|
"@pushrocks/npmextra": "^3.0.1",
|
||||||
"@pushrocks/projectinfo": "^4.0.2",
|
"@pushrocks/projectinfo": "^4.0.2",
|
||||||
"@pushrocks/qenv": "^2.0.2",
|
"@pushrocks/qenv": "^4.0.0",
|
||||||
"@pushrocks/smartcli": "^3.0.4",
|
"@pushrocks/smartanalytics": "^2.0.15",
|
||||||
"@pushrocks/smartfile": "^6.0.8",
|
"@pushrocks/smartcli": "^3.0.7",
|
||||||
"@pushrocks/smartpromise": "^2.0.5",
|
"@pushrocks/smartfile": "^7.0.2",
|
||||||
"@pushrocks/smartshell": "^2.0.6",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"@pushrocks/smartstring": "^3.0.4",
|
"@pushrocks/smartshell": "^2.0.13",
|
||||||
"@types/shelljs": "^0.8.0",
|
"@pushrocks/smartstring": "^3.0.10",
|
||||||
"beautylog": "^6.1.10",
|
"@types/shelljs": "^0.8.5"
|
||||||
"smartanalytics": "^2.0.9"
|
}
|
||||||
},
|
|
||||||
"private": true
|
|
||||||
}
|
}
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
* Have a nice day and regards
|
* Have a nice day and regards
|
||||||
* Your Open Source team at Lossless GmbH :)
|
* Your Open Source team at Lossless GmbH :)
|
||||||
*/
|
*/
|
||||||
import * as smartanalytics from 'smartanalytics';
|
import * as smartanalytics from '@pushrocks/smartanalytics';
|
||||||
let npmdockerAnalytics = new smartanalytics.Analytics({
|
const npmdockerAnalytics = new smartanalytics.Analytics({
|
||||||
apiEndPoint: 'https://pubapi.lossless.one',
|
apiEndPoint: 'https://pubapi.lossless.one',
|
||||||
appName: 'npmdocker',
|
appName: 'npmdocker',
|
||||||
projectId: 'gitzone'
|
projectId: 'gitzone'
|
||||||
|
@ -9,7 +9,6 @@ let npmdockerCli = new plugins.smartcli.Smartcli();
|
|||||||
|
|
||||||
export let run = () => {
|
export let run = () => {
|
||||||
npmdockerCli.standardTask().subscribe(async argvArg => {
|
npmdockerCli.standardTask().subscribe(async argvArg => {
|
||||||
plugins.beautylog.figletSync('npmdocker');
|
|
||||||
let configArg = await ConfigModule.run().then(DockerModule.run);
|
let configArg = await ConfigModule.run().then(DockerModule.run);
|
||||||
if (configArg.exitCode === 0) {
|
if (configArg.exitCode === 0) {
|
||||||
plugins.beautylog.success('container ended all right!');
|
plugins.beautylog.success('container ended all right!');
|
||||||
@ -28,7 +27,7 @@ export let run = () => {
|
|||||||
let configArg = await ConfigModule.run();
|
let configArg = await ConfigModule.run();
|
||||||
const smartshellInstance = new plugins.smartshell.Smartshell({
|
const smartshellInstance = new plugins.smartshell.Smartshell({
|
||||||
executor: 'bash'
|
executor: 'bash'
|
||||||
})
|
});
|
||||||
await smartshellInstance.exec(configArg.command).then(response => {
|
await smartshellInstance.exec(configArg.command).then(response => {
|
||||||
if (response.exitCode !== 0) {
|
if (response.exitCode !== 0) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
@ -42,7 +41,7 @@ export let run = () => {
|
|||||||
if (argvArg.all) {
|
if (argvArg.all) {
|
||||||
const smartshellInstance = new plugins.smartshell.Smartshell({
|
const smartshellInstance = new plugins.smartshell.Smartshell({
|
||||||
executor: 'bash'
|
executor: 'bash'
|
||||||
})
|
});
|
||||||
plugins.beautylog.ora.text('killing any running docker containers...');
|
plugins.beautylog.ora.text('killing any running docker containers...');
|
||||||
await smartshellInstance.exec(`docker kill $(docker ps -q)`);
|
await smartshellInstance.exec(`docker kill $(docker ps -q)`);
|
||||||
|
|
||||||
@ -50,7 +49,7 @@ export let run = () => {
|
|||||||
await smartshellInstance.exec(`docker rm $(docker ps -a -q)`);
|
await smartshellInstance.exec(`docker rm $(docker ps -a -q)`);
|
||||||
|
|
||||||
plugins.beautylog.ora.text('removing images...');
|
plugins.beautylog.ora.text('removing images...');
|
||||||
await smartshellInstance.exec(`docker rmi $(docker images -q -f dangling=true)`);
|
await smartshellInstance.exec(`docker rmi -f $(docker images -q -f dangling=true)`);
|
||||||
|
|
||||||
plugins.beautylog.ora.text('removing all other images...');
|
plugins.beautylog.ora.text('removing all other images...');
|
||||||
await smartshellInstance.exec(`docker rmi $(docker images -a -q)`);
|
await smartshellInstance.exec(`docker rmi $(docker images -a -q)`);
|
||||||
@ -64,7 +63,7 @@ export let run = () => {
|
|||||||
npmdockerCli.addCommand('speedtest').subscribe(async argvArg => {
|
npmdockerCli.addCommand('speedtest').subscribe(async argvArg => {
|
||||||
const smartshellInstance = new plugins.smartshell.Smartshell({
|
const smartshellInstance = new plugins.smartshell.Smartshell({
|
||||||
executor: 'bash'
|
executor: 'bash'
|
||||||
})
|
});
|
||||||
plugins.beautylog.figletSync('npmdocker');
|
plugins.beautylog.figletSync('npmdocker');
|
||||||
plugins.beautylog.ok('Starting speedtest');
|
plugins.beautylog.ok('Starting speedtest');
|
||||||
await smartshellInstance.exec(
|
await smartshellInstance.exec(
|
||||||
|
@ -4,7 +4,7 @@ import * as snippets from './npmdocker.snippets';
|
|||||||
|
|
||||||
const smartshellInstance = new plugins.smartshell.Smartshell({
|
const smartshellInstance = new plugins.smartshell.Smartshell({
|
||||||
executor: 'bash'
|
executor: 'bash'
|
||||||
})
|
});
|
||||||
|
|
||||||
// interfaces
|
// interfaces
|
||||||
import { IConfig } from './npmdocker.config';
|
import { IConfig } from './npmdocker.config';
|
||||||
@ -28,7 +28,7 @@ let dockerData = {
|
|||||||
let checkDocker = () => {
|
let checkDocker = () => {
|
||||||
let done = plugins.smartpromise.defer();
|
let done = plugins.smartpromise.defer();
|
||||||
plugins.beautylog.ora.text('checking docker...');
|
plugins.beautylog.ora.text('checking docker...');
|
||||||
|
|
||||||
if (smartshellInstance.exec('which docker')) {
|
if (smartshellInstance.exec('which docker')) {
|
||||||
plugins.beautylog.ok('Docker found!');
|
plugins.beautylog.ok('Docker found!');
|
||||||
done.resolve();
|
done.resolve();
|
||||||
@ -74,7 +74,7 @@ let buildDockerImage = async () => {
|
|||||||
plugins.beautylog.ok('Dockerimage built!');
|
plugins.beautylog.ok('Dockerimage built!');
|
||||||
};
|
};
|
||||||
|
|
||||||
let buildDockerProjectMountString = async () => {
|
const buildDockerProjectMountString = async () => {
|
||||||
if (process.env.CI !== 'true') {
|
if (process.env.CI !== 'true') {
|
||||||
dockerData.dockerProjectMountString = `-v ${paths.cwd}:/workspace`;
|
dockerData.dockerProjectMountString = `-v ${paths.cwd}:/workspace`;
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ let buildDockerProjectMountString = async () => {
|
|||||||
/**
|
/**
|
||||||
* builds an environment string that docker cli understands
|
* builds an environment string that docker cli understands
|
||||||
*/
|
*/
|
||||||
let buildDockerEnvString = async () => {
|
const buildDockerEnvString = async () => {
|
||||||
for (let keyValueObjectArg of config.keyValueObjectArray) {
|
for (let keyValueObjectArg of config.keyValueObjectArray) {
|
||||||
let envString = (dockerData.dockerEnvString =
|
let envString = (dockerData.dockerEnvString =
|
||||||
dockerData.dockerEnvString + `-e ${keyValueObjectArg.key}=${keyValueObjectArg.value} `);
|
dockerData.dockerEnvString + `-e ${keyValueObjectArg.key}=${keyValueObjectArg.value} `);
|
||||||
@ -93,7 +93,7 @@ let buildDockerEnvString = async () => {
|
|||||||
/**
|
/**
|
||||||
* creates string to mount the docker.sock inside the testcontainer
|
* creates string to mount the docker.sock inside the testcontainer
|
||||||
*/
|
*/
|
||||||
let buildDockerSockString = async () => {
|
const buildDockerSockString = async () => {
|
||||||
if (config.dockerSock) {
|
if (config.dockerSock) {
|
||||||
dockerData.dockerSockString = `-v /var/run/docker.sock:/var/run/docker.sock`;
|
dockerData.dockerSockString = `-v /var/run/docker.sock:/var/run/docker.sock`;
|
||||||
}
|
}
|
||||||
|
0
ts/npmdocker.logging.ts
Normal file
0
ts/npmdocker.logging.ts
Normal file
@ -1,3 +1,10 @@
|
|||||||
{
|
{
|
||||||
"extends": "tslint-config-standard"
|
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||||
|
"rules": {
|
||||||
|
"semicolon": [true, "always"],
|
||||||
|
"no-console": false,
|
||||||
|
"ordered-imports": false,
|
||||||
|
"object-literal-sort-keys": false
|
||||||
|
},
|
||||||
|
"defaultSeverity": "warning"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user