Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
56612f9ac9 | |||
2a1fcd8cdb | |||
09911328b2 | |||
548e32419e | |||
2b2b06b48b | |||
37028a9b1f | |||
3cba5844d8 | |||
a3ceb68eab |
@ -1,4 +1,4 @@
|
||||
image: hosttoday/ht-docker-dbase
|
||||
image: hosttoday/ht-docker-dbase:npmts
|
||||
services:
|
||||
- docker:dind
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
FROM hosttoday/ht-docker-node:npmts
|
||||
RUN mkdir app-node
|
||||
COPY ./ /app-node/
|
||||
WORKDIR /app-node
|
||||
ENV CI true
|
||||
CMD ["npmts"]
|
@ -1,5 +1,5 @@
|
||||
# dockersock
|
||||
easy communication with docker from node, TypeScript ready
|
||||
easy communication with docker remote api from node, TypeScript ready
|
||||
|
||||
## Status
|
||||
[](https://gitlab.com/pushrocks/dockersock/commits/master)
|
||||
|
20
dist/dockersock.classes.dockersock.js
vendored
20
dist/dockersock.classes.dockersock.js
vendored
File diff suppressed because one or more lines are too long
@ -2,5 +2,10 @@
|
||||
"npmts":{
|
||||
"mode":"default",
|
||||
"coverageTreshold":10
|
||||
},
|
||||
"npmdocker":{
|
||||
"baseImage":"hosttoday/ht-docker-node:npmts",
|
||||
"command":"npmts",
|
||||
"dockerSock":"true"
|
||||
}
|
||||
}
|
12
package.json
12
package.json
@ -1,14 +1,11 @@
|
||||
{
|
||||
"name": "dockersock",
|
||||
"version": "1.0.14",
|
||||
"description": "easy communication with docker from node, TypeScript ready",
|
||||
"version": "1.0.16",
|
||||
"description": "easy communication with docker remote api from node, TypeScript ready",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"test": "npmts --notest && npm run build && npm run startdocker && npm run cleanup",
|
||||
"build": "docker build -t npmts-test-image .",
|
||||
"startdocker": "docker run -v /var/run/docker.sock:/var/run/docker.sock --name npmts-test-container npmts-test-image",
|
||||
"cleanup": "docker rm npmts-test-container && docker rmi npmts-test-image"
|
||||
"test": "npmdocker"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -28,7 +25,8 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/pushrocks/dockersock#README",
|
||||
"dependencies": {
|
||||
"@types/q": "*",
|
||||
"@types/q": "^0.0.27",
|
||||
"@types/request": "^0.0.27",
|
||||
"beautylog": "^5.0.14",
|
||||
"q": "^1.4.1",
|
||||
"request": "^2.73.0",
|
||||
|
@ -121,7 +121,21 @@ export class Dockersock {
|
||||
});
|
||||
};
|
||||
getChangeObservable(){
|
||||
let requestStream = plugins.request.get(this.sockPath + "/events");
|
||||
let options = {
|
||||
method:"GET",
|
||||
url:this.sockPath + "/events",
|
||||
headers:{
|
||||
"Content-Type":"application/json",
|
||||
"Host":"docker.sock"
|
||||
}
|
||||
};
|
||||
let requestStream = plugins.request(options,(err, res, body) => {
|
||||
if (!err && res.statusCode == 200) {
|
||||
} else {
|
||||
console.log(err);
|
||||
console.log(res);
|
||||
};
|
||||
});
|
||||
requestStream.on("response",(response) => {
|
||||
if(response.statusCode == 200){
|
||||
plugins.beautylog.ok("request returned status 200, so we are good!");
|
||||
@ -131,7 +145,6 @@ export class Dockersock {
|
||||
});
|
||||
let changeObservable = Observable.fromEvent(requestStream,"data");
|
||||
requestStream.on("end",()=> {
|
||||
|
||||
});
|
||||
return changeObservable;
|
||||
}
|
||||
|
Reference in New Issue
Block a user