now using same docker push function across all stages

This commit is contained in:
Philipp Kunz 2016-06-07 23:21:56 +02:00
parent a4d66744be
commit 45e41500bc
5 changed files with 4 additions and 23 deletions

View File

@ -6,7 +6,6 @@ export declare let buildDockerfiles: (sortedArrayArg: Dockerfile[]) => any;
export declare let pushDockerfiles: (sortedArrayArg: Dockerfile[]) => any; export declare let pushDockerfiles: (sortedArrayArg: Dockerfile[]) => any;
export declare let pullDockerfileImages: (sortableArrayArg: Dockerfile[], registryArg?: string) => any; export declare let pullDockerfileImages: (sortableArrayArg: Dockerfile[], registryArg?: string) => any;
export declare let testDockerfiles: (sortedArrayArg: Dockerfile[]) => any; export declare let testDockerfiles: (sortedArrayArg: Dockerfile[]) => any;
export declare let releaseDockerfiles: (sortedArrayArg: Dockerfile[], registryArg?: any) => any;
export declare class Dockerfile { export declare class Dockerfile {
filePath: string; filePath: string;
repo: string; repo: string;

File diff suppressed because one or more lines are too long

View File

@ -27,9 +27,9 @@ var publishDocker = function () {
var done = plugins.q.defer(); var done = plugins.q.defer();
NpmciBuildDocker.readDockerfiles() NpmciBuildDocker.readDockerfiles()
.then(NpmciBuildDocker.pullDockerfileImages) .then(NpmciBuildDocker.pullDockerfileImages)
.then(NpmciBuildDocker.releaseDockerfiles) .then(NpmciBuildDocker.pushDockerfiles)
.then(done.resolve); .then(done.resolve);
return done.promise; return done.promise;
}; };
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnB1Ymxpc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDJCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUVsQyxJQUFZLGdCQUFnQixXQUFNLHNCQUVsQyxD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bGREb2NrZXIucHVzaERvY2tlcmZpbGVzKVxyXG4gICAgICAgIC50aGVuKGRvbmUucmVzb2x2ZSk7XHJcbiAgICByZXR1cm4gZG9uZS5wcm9taXNlO1xyXG59OyJdfQ==

View File

@ -110,15 +110,6 @@ export let testDockerfiles = (sortedArrayArg:Dockerfile[]) => {
return done.promise; return done.promise;
}; };
export let releaseDockerfiles = (sortedArrayArg:Dockerfile[], registryArg = NpmciEnv.dockerRegistry) => {
let done = plugins.q.defer();
sortedArrayArg.forEach(function(dockerfileArg){
dockerfileArg.push(registryArg);
});
done.resolve(sortedArrayArg);
return done.promise;
}
export class Dockerfile { export class Dockerfile {
filePath:string; filePath:string;
repo:string; repo:string;

View File

@ -29,7 +29,7 @@ let publishDocker = function(){
let done = plugins.q.defer(); let done = plugins.q.defer();
NpmciBuildDocker.readDockerfiles() NpmciBuildDocker.readDockerfiles()
.then(NpmciBuildDocker.pullDockerfileImages) .then(NpmciBuildDocker.pullDockerfileImages)
.then(NpmciBuildDocker.releaseDockerfiles) .then(NpmciBuildDocker.pushDockerfiles)
.then(done.resolve); .then(done.resolve);
return done.promise; return done.promise;
}; };