Compare commits

..

12 Commits

Author SHA1 Message Date
b5c4727bae 1.0.51 2019-08-16 21:45:22 +02:00
b6f3fbf8a9 fix(core): update 2019-08-16 21:45:21 +02:00
7241e7a8fd 1.0.50 2019-08-16 21:34:36 +02:00
ae37148ece fix(core): update 2019-08-16 21:34:35 +02:00
65c37bdd6f 1.0.49 2019-08-16 21:21:31 +02:00
6acbe30e2e fix(core): update 2019-08-16 21:21:30 +02:00
eb6f7889d0 1.0.48 2019-08-16 21:10:03 +02:00
e39da5fee9 fix(core): update 2019-08-16 21:10:03 +02:00
b07628bb0b 1.0.47 2019-08-16 21:07:59 +02:00
5815f9b202 fix(core): update 2019-08-16 21:07:59 +02:00
846ea9997e 1.0.46 2019-08-16 18:32:42 +02:00
de54db33ad fix(core): update 2019-08-16 18:32:41 +02:00
8 changed files with 23 additions and 15 deletions

View File

@ -39,6 +39,8 @@ snyk:
# ====================
testLTS:
services:
- docker:18-dind
stage: test
script:
- npmci npm prepare
@ -48,7 +50,7 @@ testLTS:
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
- priv
testBuild:
stage: test

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/docker",
"version": "1.0.45",
"version": "1.0.51",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/docker",
"version": "1.0.45",
"version": "1.0.51",
"description": "easy communication with docker remote api from node, TypeScript ready",
"private": false,
"main": "dist/index.js",

View File

@ -73,7 +73,8 @@ tap.test('should create a service', async () => {
'testlabel': 'hi'
},
Name: 'testService',
networks: [testNetwork]
networks: [testNetwork],
networkAlias: 'testService'
});
});

View File

@ -12,8 +12,16 @@ export class DockerHost {
* the constructor to instantiate a new docker sock instance
* @param pathArg
*/
constructor(pathArg: string = 'http://unix:/var/run/docker.sock:') {
this.socketPath = pathArg;
constructor(pathArg?: string) {
let pathToUse: string;
if (pathArg) {
pathToUse = pathArg;
} else if (process.env.CI) {
pathToUse = 'http://docker:2375/';
} else {
pathToUse = 'http://unix:/var/run/docker.sock:';
}
this.socketPath = pathToUse;
}
/**

View File

@ -112,14 +112,6 @@ export class DockerImage {
});
}
/**
* returns a boolean wether the image has a upstream image
*/
public isUpstreamImage(): boolean {
// TODO: implement isUpastreamImage
return this.RepoTags.length > 0;
}
public tagImage(newTag) {}
/**

View File

@ -32,7 +32,7 @@ export class DockerService {
for (const network of serviceCreationDescriptor.networks) {
networkArray.push({
Target: network.Name,
Aliases: []
Aliases: [serviceCreationDescriptor.networkAlias]
});
}
@ -56,4 +56,8 @@ export class DockerService {
this.dockerHost = dockerHostArg;
Object.assign(this, serviceObject);
}
update() {
// TODO: implemnt updating service
}
}

View File

@ -6,4 +6,5 @@ export interface IServiceCreationDescriptor {
Image: string;
Labels: interfaces.TLabels;
networks: DockerNetwork[];
networkAlias: string;
}