fix(core): update

This commit is contained in:
2018-10-29 01:07:39 +01:00
parent df09ff0f9b
commit 18d16feaa9
6 changed files with 176 additions and 159 deletions

View File

@ -9,7 +9,7 @@
* Have a nice day and regards
* Your Open Source team at Lossless GmbH :)
*/
import * as smartanalytics from 'smartanalytics';
import * as smartanalytics from '@pushrocks/smartanalytics';
let npmdockerAnalytics = new smartanalytics.Analytics({
apiEndPoint: 'https://pubapi.lossless.one',
appName: 'npmdocker',

View File

@ -28,7 +28,7 @@ export let run = () => {
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);
@ -42,7 +42,7 @@ export let run = () => {
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)`);
@ -64,7 +64,7 @@ export let run = () => {
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(

View File

@ -4,7 +4,7 @@ import * as snippets from './npmdocker.snippets';
const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash'
})
});
// interfaces
import { IConfig } from './npmdocker.config';
@ -28,7 +28,7 @@ let dockerData = {
let checkDocker = () => {
let done = plugins.smartpromise.defer();
plugins.beautylog.ora.text('checking docker...');
if (smartshellInstance.exec('which docker')) {
plugins.beautylog.ok('Docker found!');
done.resolve();
@ -74,7 +74,7 @@ let buildDockerImage = async () => {
plugins.beautylog.ok('Dockerimage built!');
};
let buildDockerProjectMountString = async () => {
const buildDockerProjectMountString = async () => {
if (process.env.CI !== 'true') {
dockerData.dockerProjectMountString = `-v ${paths.cwd}:/workspace`;
}
@ -83,7 +83,7 @@ let buildDockerProjectMountString = async () => {
/**
* builds an environment string that docker cli understands
*/
let buildDockerEnvString = async () => {
const buildDockerEnvString = async () => {
for (let keyValueObjectArg of config.keyValueObjectArray) {
let envString = (dockerData.dockerEnvString =
dockerData.dockerEnvString + `-e ${keyValueObjectArg.key}=${keyValueObjectArg.value} `);
@ -93,7 +93,7 @@ let buildDockerEnvString = async () => {
/**
* creates string to mount the docker.sock inside the testcontainer
*/
let buildDockerSockString = async () => {
const buildDockerSockString = async () => {
if (config.dockerSock) {
dockerData.dockerSockString = `-v /var/run/docker.sock:/var/run/docker.sock`;
}