fix(core): update
This commit is contained in:
parent
edec48529d
commit
90eac3e50a
9870
package-lock.json
generated
9870
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@ -27,26 +27,26 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/dockersock#README",
|
"homepage": "https://gitlab.com/pushrocks/dockersock#README",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/lik": "^3.0.19",
|
"@pushrocks/lik": "^4.0.17",
|
||||||
"@pushrocks/smartfile": "^7.0.11",
|
"@pushrocks/smartfile": "^8.0.0",
|
||||||
"@pushrocks/smartjson": "^3.0.10",
|
"@pushrocks/smartjson": "^3.0.10",
|
||||||
"@pushrocks/smartlog": "^2.0.21",
|
"@pushrocks/smartlog": "^2.0.39",
|
||||||
"@pushrocks/smartnetwork": "^1.1.18",
|
"@pushrocks/smartnetwork": "^1.1.22",
|
||||||
"@pushrocks/smartpath": "^4.0.1",
|
"@pushrocks/smartpath": "^4.0.3",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"@pushrocks/smartrequest": "^1.1.47",
|
"@pushrocks/smartrequest": "^1.1.51",
|
||||||
"@pushrocks/smartstring": "^3.0.18",
|
"@pushrocks/smartstring": "^3.0.18",
|
||||||
"@pushrocks/smartversion": "^2.0.4",
|
"@pushrocks/smartversion": "^2.0.4",
|
||||||
"@tsclass/tsclass": "^3.0.13",
|
"@tsclass/tsclass": "^3.0.25",
|
||||||
"rxjs": "^6.5.4"
|
"rxjs": "^6.6.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.22",
|
"@gitzone/tsbuild": "^2.1.25",
|
||||||
"@gitzone/tsrun": "^1.2.8",
|
"@gitzone/tsrun": "^1.2.12",
|
||||||
"@gitzone/tstest": "^1.0.28",
|
"@gitzone/tstest": "^1.0.48",
|
||||||
"@pushrocks/tapbundle": "^3.2.1",
|
"@pushrocks/tapbundle": "^3.2.9",
|
||||||
"@types/node": "^13.9.3",
|
"@types/node": "^14.11.2",
|
||||||
"tslint": "^6.1.0",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -2,6 +2,7 @@ import * as plugins from './docker.plugins';
|
|||||||
import * as interfaces from './interfaces';
|
import * as interfaces from './interfaces';
|
||||||
|
|
||||||
import { DockerHost } from './docker.classes.host';
|
import { DockerHost } from './docker.classes.host';
|
||||||
|
import { logger } from './docker.logging';
|
||||||
|
|
||||||
export class DockerContainer {
|
export class DockerContainer {
|
||||||
// STATIC
|
// STATIC
|
||||||
@ -47,9 +48,9 @@ export class DockerContainer {
|
|||||||
User: 'root'
|
User: 'root'
|
||||||
});
|
});
|
||||||
if (response.statusCode < 300) {
|
if (response.statusCode < 300) {
|
||||||
plugins.smartlog.defaultLogger.log('info', 'Container created successfully');
|
logger.log('info', 'Container created successfully');
|
||||||
} else {
|
} else {
|
||||||
plugins.smartlog.defaultLogger.log(
|
logger.log(
|
||||||
'error',
|
'error',
|
||||||
'There has been a problem when creating the container'
|
'There has been a problem when creating the container'
|
||||||
);
|
);
|
||||||
|
@ -2,6 +2,7 @@ import * as plugins from './docker.plugins';
|
|||||||
import { DockerContainer } from './docker.classes.container';
|
import { DockerContainer } from './docker.classes.container';
|
||||||
import { DockerNetwork } from './docker.classes.network';
|
import { DockerNetwork } from './docker.classes.network';
|
||||||
import { DockerService } from './docker.classes.service';
|
import { DockerService } from './docker.classes.service';
|
||||||
|
import { logger } from './docker.logging';
|
||||||
|
|
||||||
export interface IAuthData {
|
export interface IAuthData {
|
||||||
serveraddress: string;
|
serveraddress: string;
|
||||||
@ -138,9 +139,9 @@ export class DockerHost {
|
|||||||
ForceNewCluster: false
|
ForceNewCluster: false
|
||||||
});
|
});
|
||||||
if (response.statusCode === 200) {
|
if (response.statusCode === 200) {
|
||||||
plugins.smartlog.defaultLogger.log('info', 'created Swam succesfully');
|
logger.log('info', 'created Swam succesfully');
|
||||||
} else {
|
} else {
|
||||||
plugins.smartlog.defaultLogger.log('error', 'could not initiate swarm');
|
logger.log('error', 'could not initiate swarm');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import * as plugins from './docker.plugins';
|
import * as plugins from './docker.plugins';
|
||||||
import * as interfaces from './interfaces';
|
import * as interfaces from './interfaces';
|
||||||
import { DockerHost } from './docker.classes.host';
|
import { DockerHost } from './docker.classes.host';
|
||||||
|
import { logger } from './docker.logging';
|
||||||
|
|
||||||
export class DockerImage {
|
export class DockerImage {
|
||||||
// STATIC
|
// STATIC
|
||||||
@ -63,14 +64,14 @@ export class DockerImage {
|
|||||||
)}&tag=${encodeURIComponent(imageUrlObject.imageTag)}`
|
)}&tag=${encodeURIComponent(imageUrlObject.imageTag)}`
|
||||||
);
|
);
|
||||||
if (response.statusCode < 300) {
|
if (response.statusCode < 300) {
|
||||||
plugins.smartlog.defaultLogger.log(
|
logger.log(
|
||||||
'info',
|
'info',
|
||||||
`Successfully pulled image ${imageUrlObject.imageUrl} from the registry`
|
`Successfully pulled image ${imageUrlObject.imageUrl} from the registry`
|
||||||
);
|
);
|
||||||
const image = await DockerImage.findImageByName(dockerHostArg, imageUrlObject.imageOriginTag);
|
const image = await DockerImage.findImageByName(dockerHostArg, imageUrlObject.imageOriginTag);
|
||||||
return image;
|
return image;
|
||||||
} else {
|
} else {
|
||||||
plugins.smartlog.defaultLogger.log('error', `Failed at the attempt of creating a new image`);
|
logger.log('error', `Failed at the attempt of creating a new image`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ import * as interfaces from './interfaces';
|
|||||||
|
|
||||||
import { DockerHost } from './docker.classes.host';
|
import { DockerHost } from './docker.classes.host';
|
||||||
import { DockerService } from './docker.classes.service';
|
import { DockerService } from './docker.classes.service';
|
||||||
|
import { logger } from './docker.logging';
|
||||||
|
|
||||||
export class DockerNetwork {
|
export class DockerNetwork {
|
||||||
public static async getNetworks(dockerHost: DockerHost): Promise<DockerNetwork[]> {
|
public static async getNetworks(dockerHost: DockerHost): Promise<DockerNetwork[]> {
|
||||||
@ -45,10 +46,10 @@ export class DockerNetwork {
|
|||||||
Ingress: false
|
Ingress: false
|
||||||
});
|
});
|
||||||
if (response.statusCode < 300) {
|
if (response.statusCode < 300) {
|
||||||
plugins.smartlog.defaultLogger.log('info', 'Created network successfully');
|
logger.log('info', 'Created network successfully');
|
||||||
return await DockerNetwork.getNetworkByName(dockerHost, networkCreationDescriptor.Name);
|
return await DockerNetwork.getNetworkByName(dockerHost, networkCreationDescriptor.Name);
|
||||||
} else {
|
} else {
|
||||||
plugins.smartlog.defaultLogger.log(
|
logger.log(
|
||||||
'error',
|
'error',
|
||||||
'There has been an error creating the wanted network'
|
'There has been an error creating the wanted network'
|
||||||
);
|
);
|
||||||
|
@ -4,6 +4,7 @@ import * as interfaces from './interfaces';
|
|||||||
import { DockerHost } from './docker.classes.host';
|
import { DockerHost } from './docker.classes.host';
|
||||||
import { DockerImage } from './docker.classes.image';
|
import { DockerImage } from './docker.classes.image';
|
||||||
import { DockerSecret } from './docker.classes.secret';
|
import { DockerSecret } from './docker.classes.secret';
|
||||||
|
import { logger } from './docker.logging';
|
||||||
|
|
||||||
export class DockerService {
|
export class DockerService {
|
||||||
// STATIC
|
// STATIC
|
||||||
@ -37,7 +38,7 @@ export class DockerService {
|
|||||||
serviceCreationDescriptor: interfaces.IServiceCreationDescriptor
|
serviceCreationDescriptor: interfaces.IServiceCreationDescriptor
|
||||||
): Promise<DockerService> {
|
): Promise<DockerService> {
|
||||||
// lets get the image
|
// lets get the image
|
||||||
plugins.smartlog.defaultLogger.log(
|
logger.log(
|
||||||
'info',
|
'info',
|
||||||
`now creating service ${serviceCreationDescriptor.name}`
|
`now creating service ${serviceCreationDescriptor.name}`
|
||||||
);
|
);
|
||||||
|
3
ts/docker.logging.ts
Normal file
3
ts/docker.logging.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import * as plugins from './docker.plugins';
|
||||||
|
|
||||||
|
export const logger = new plugins.smartlog.ConsoleLog();
|
@ -15,8 +15,6 @@ import * as smartrequest from '@pushrocks/smartrequest';
|
|||||||
import * as smartstring from '@pushrocks/smartstring';
|
import * as smartstring from '@pushrocks/smartstring';
|
||||||
import * as smartversion from '@pushrocks/smartversion';
|
import * as smartversion from '@pushrocks/smartversion';
|
||||||
|
|
||||||
smartlog.defaultLogger.enableConsole();
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
lik,
|
lik,
|
||||||
smartfile,
|
smartfile,
|
||||||
|
Loading…
Reference in New Issue
Block a user