Compare commits

..

8 Commits

Author SHA1 Message Date
56612f9ac9 1.0.16 2016-07-29 20:41:30 +02:00
2a1fcd8cdb fixed request for change observable 2016-07-29 20:41:27 +02:00
09911328b2 1.0.15 2016-07-28 19:41:27 +02:00
548e32419e improve README 2016-07-28 19:41:14 +02:00
2b2b06b48b Merge branch 'master' of gitlab.com:pushrocks/dockersock 2016-07-28 19:38:40 +02:00
37028a9b1f add npmdocker 2016-07-28 19:38:26 +02:00
3cba5844d8 fix dep versions 2016-07-18 04:07:52 +02:00
a3ceb68eab add request typings 2016-07-18 04:06:56 +02:00
7 changed files with 46 additions and 20 deletions

View File

@ -1,4 +1,4 @@
image: hosttoday/ht-docker-dbase
image: hosttoday/ht-docker-dbase:npmts
services:
- docker:dind

View File

@ -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"]

View File

@ -1,5 +1,5 @@
# dockersock
easy communication with docker from node, TypeScript ready
easy communication with docker remote api from node, TypeScript ready
## Status
[![build status](https://gitlab.com/pushrocks/dockersock/badges/master/build.svg)](https://gitlab.com/pushrocks/dockersock/commits/master)

File diff suppressed because one or more lines are too long

View File

@ -2,5 +2,10 @@
"npmts":{
"mode":"default",
"coverageTreshold":10
},
"npmdocker":{
"baseImage":"hosttoday/ht-docker-node:npmts",
"command":"npmts",
"dockerSock":"true"
}
}

View File

@ -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",

View File

@ -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!");
@ -130,8 +144,7 @@ export class Dockersock {
}
});
let changeObservable = Observable.fromEvent(requestStream,"data");
requestStream.on("end",()=> {
requestStream.on("end",()=> {
});
return changeObservable;
}