now encoding URI

This commit is contained in:
Philipp Kunz 2016-07-18 00:54:41 +02:00
parent cec9555908
commit 4e3446cb2f
10 changed files with 21 additions and 15 deletions

View File

@ -3,4 +3,4 @@ RUN mkdir app-node
COPY ./ /app-node/
WORKDIR /app-node
ENV CI true
CMD ["npmts"]
CMD ["npmci","install","stable"]

View File

@ -12,7 +12,7 @@ export declare class Dockersock {
listContainersStopped(): plugins.q.Promise<{}>;
listImages(): plugins.q.Promise<{}>;
listImagesDangling(): plugins.q.Promise<{}>;
pullImage(imageLabel: string): plugins.q.Promise<{}>;
pullImage(imageLabelArg: string): plugins.q.Promise<{}>;
createContainer(optionsArg: any, pullFirstArg?: boolean): plugins.q.Promise<{}>;
getContainerId(): void;
startContainer(containerNameArg: any): plugins.q.Promise<{}>;

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
import "typings-global";
export import beautylog = require("beautylog");
export import q = require("q");
export declare let request: any;
export import request = require("request");
export import rxjs = require("rxjs");

View File

@ -4,4 +4,4 @@ exports.beautylog = require("beautylog");
exports.q = require("q");
exports.request = require("request");
exports.rxjs = require("rxjs");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9ja2Vyc29jay5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvZG9ja2Vyc29jay5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFDVixpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ2pDLFNBQUMsV0FBVyxHQUFHLENBQUMsQ0FBQztBQUNwQixlQUFPLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDO0FBQzFCLFlBQUksV0FBVyxNQUFNLENBQUMsQ0FBQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9ja2Vyc29jay5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvZG9ja2Vyc29jay5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFDVixpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ2pDLFNBQUMsV0FBVyxHQUFHLENBQUMsQ0FBQztBQUNqQixlQUFPLFdBQVcsU0FBUyxDQUFDLENBQUM7QUFDN0IsWUFBSSxXQUFXLE1BQU0sQ0FBQyxDQUFDIn0=

View File

@ -1,4 +1,6 @@
{
"mode":"default",
"coverageTreshold":10
"npmts":{
"mode":"default",
"coverageTreshold":10
}
}

View File

@ -26,11 +26,11 @@ describe("dockersock", function () {
});
it("should pull an image from imagetag", function (done) {
this.timeout(60000);
testDockersock.pullImage("hosttoday%2Fht-docker-dbase")
testDockersock.pullImage("hosttoday/ht-docker-dbase")
.then((dataArg) => {
done();
}, done);
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FBYyxDQUFDLENBQUE7QUFDdEIsUUFBTyxRQUFRLENBQUMsQ0FBQTtBQUVoQix3QkFBeUIsZUFFekIsQ0FBQyxDQUZ1QztBQUV4QyxRQUFRLENBQUMsWUFBWSxFQUFDO0lBQ2xCLFFBQVEsQ0FBQyxlQUFlLEVBQUM7UUFDckIsSUFBSSxjQUF5QixDQUFDO1FBQzlCLEVBQUUsQ0FBQyx5Q0FBeUMsRUFBQztZQUN6QyxjQUFjLEdBQUcsSUFBSSxrQkFBVSxFQUFFLENBQUM7WUFDbEMsY0FBYyxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsVUFBV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0FBQztRQUNILEVBQUUsQ0FBQyxvQ0FBb0MsRUFBQyxVQUFTLElBQUk7WUFDakQsSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUNwQixjQUFjLENBQUMsU0FBUyxDQUFDLDJCQUEyQixDQUFDO2lCQUNoRCxJQUFJLENBQUMsQ0FBQyxPQUFPO2dCQUNWLElBQUksRUFBRSxDQUFDO1lBQ1gsQ0FBQyxFQUFDLElBQUksQ0FBQyxDQUFDO1FBQ2hCLENBQUMsQ0FBQyxDQUFBO0lBQ04sQ0FBQyxDQUFDLENBQUM7QUFDUCxDQUFDLENBQUMsQ0FBQyJ9

View File

@ -27,7 +27,7 @@ describe("dockersock",function(){
});
it("should pull an image from imagetag",function(done){
this.timeout(60000);
testDockersock.pullImage("hosttoday%2Fht-docker-dbase")
testDockersock.pullImage("hosttoday/ht-docker-dbase")
.then((dataArg)=>{
done();
},done);

View File

@ -57,7 +57,8 @@ export class Dockersock {
listImagesDangling(){
return this.request("GET","/images","?dangling=true");
}
pullImage(imageLabel:string){
pullImage(imageLabelArg:string){
let imageLabel = encodeURI(imageLabelArg);
return this.requestStream("POST","/images/create?fromImage=" + imageLabel);
};
createContainer(optionsArg,pullFirstArg:boolean = true){
@ -147,13 +148,14 @@ export class Dockersock {
},
body:jsonArg
};
console.log(options);
plugins.request(options,(err, res, body) => {
if (!err && res.statusCode == 200) {
var responseObj = JSON.parse(body);
done.resolve(responseObj);
} else {
console.log(err);
console.log(res);
//console.log(res);
done.reject(err);
};
});

View File

@ -1,5 +1,5 @@
import "typings-global";
export import beautylog = require("beautylog");
export import q = require("q");
export let request = require("request");
export import request = require("request");
export import rxjs = require("rxjs");