now building and pushing Dockerfiles with automatic tag recognition

This commit is contained in:
Philipp Kunz 2016-06-05 05:16:14 +02:00
parent 6b72652c7a
commit 9c7afba849
11 changed files with 89 additions and 34 deletions

File diff suppressed because one or more lines are too long

2
dist/npmci.env.d.ts vendored
View File

@ -5,5 +5,5 @@ export declare let repo: GitRepo;
export declare let dockerTestTag: string;
export declare let dockerReleaseTag: string;
export declare let dockerRegistry: any;
export declare let dockerImages: any;
export declare let dockerFilesBuilt: Dockerfile[];
export declare let dockerFiles: Dockerfile[];

4
dist/npmci.env.js vendored
View File

@ -2,5 +2,7 @@
require("typings-global");
var smartstring_1 = require("smartstring");
exports.repo = new smartstring_1.GitRepo(process.env.CI_BUILD_REPO);
exports.dockerFilesBuilt = [];
exports.dockerFiles = [];
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLmVudi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBRXhCLDRCQUFzQixhQUFhLENBQUMsQ0FBQTtBQUd6QixZQUFJLEdBQUcsSUFBSSxxQkFBTyxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsYUFBYSxDQUFDLENBQUM7QUFNckIiLCJmaWxlIjoibnBtY2kuZW52LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIjtcbmltcG9ydCAqIGFzIHBsdWdpbnMgZnJvbSBcIi4vbnBtY2kucGx1Z2luc1wiO1xuaW1wb3J0IHtHaXRSZXBvfSBmcm9tIFwic21hcnRzdHJpbmdcIjtcbmltcG9ydCB7RG9ja2VyZmlsZX0gZnJvbSBcIi4vbnBtY2kuYnVpbGQuZG9ja2VyXCJcblxuZXhwb3J0IGxldCByZXBvID0gbmV3IEdpdFJlcG8ocHJvY2Vzcy5lbnYuQ0lfQlVJTERfUkVQTyk7XG5leHB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nN0cmluZztcblxuZXhwb3J0IGxldCBkb2NrZXJSZWdpc3RyeTsgLy8gd2lsbCBiZSBzZXQgYnkgbnBtY2kucHJlcGFyZVxuZXhwb3J0IGxldCBkb2NrZXJGaWxlc0J1aWx0OkRvY2tlcmZpbGVbXSA9IFtdO1xuZXhwb3J0IGxldCBkb2NrZXJGaWxlczpEb2NrZXJmaWxlW10gPSBbXTtcblxuIl19

View File

@ -2,6 +2,7 @@ import "typings-global";
export import beautylog = require("beautylog");
export declare let commander: any;
export declare let gulp: any;
export declare let gulpFunction: any;
export import path = require("path");
export declare let q: any;
export declare let request: any;

View File

@ -3,6 +3,7 @@ require("typings-global");
exports.beautylog = require("beautylog");
exports.commander = require("commander");
exports.gulp = require("gulp");
exports.gulpFunction = require("gulp-function");
exports.path = require("path");
exports.q = require("q");
exports.request = require("request");
@ -11,4 +12,4 @@ exports.smartssh = require("smartssh");
exports.smartstring = require("smartstring");
exports.smartfile = require("smartfile");
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUNWLGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUM7QUFDcEMsaUJBQVMsR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUM7QUFDakMsWUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUNwQixZQUFJLFdBQVcsTUFBTSxDQUFDLENBQUM7QUFDMUIsU0FBQyxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNqQixlQUFPLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDO0FBQzdCLGVBQU8sR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDMUIsZ0JBQVEsV0FBVyxVQ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Rzc2hcIik7XG5leHBvcnQgaW1wb3J0IHNtYXJ0c3RyaW5nID0gcmVxdWlyZShcInNtYXJ0c3RyaW5nXCIpO1xuZXhwb3J0IGltcG9ydCBzbWFydGZpbGUgPSByZXF1aXJlKFwic21hcnRmaWxlXCIpOyJdfQ==

14
dist/npmci.publish.js vendored
View File

@ -3,6 +3,7 @@ require("typings-global");
var plugins = require("./npmci.plugins");
var npmci_prepare_1 = require("./npmci.prepare");
var npmci_bash_1 = require("./npmci.bash");
var NpmciEnv = require("./npmci.env");
exports.publish = function (serviceArg) {
if (serviceArg === void 0) { serviceArg = "npm"; }
switch (serviceArg) {
@ -24,7 +25,18 @@ var publishNpm = function () {
};
var publishDocker = function () {
var done = plugins.q.defer();
NpmciEnv.dockerFilesBuilt.forEach(function (dockerfileArg) {
dockerfileArg.push();
});
return done.promise;
};
var publishDockerTest = function () {
var done = plugins.q.defer();
NpmciEnv.dockerFilesBuilt.forEach(function (dockerfileArg) {
dockerfileArg.push();
});
done.resolve();
return done.promise;
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnB1Ymxpc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDJCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUd2QixlQUFPLEdBQUcsVUFBQyxVQUF5QjtJQUF6QiwwQkFBeUIsR0FBekIsa0JBQXlCO0lBQzNDLE1BQU0sQ0FBQyxDQUFDLFVBQVUsQ0FBQyxDQUFBLENBQUM7UUFDaEIsS0FBSyxLQUFLO1lBQ04sTUFBTSxDQUFDLFVBQVUsRUFBRSxDQUFDO1FBQ3hCLEtBQUssUUFBUTtZQUNULE1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oc2VydmljZUFyZyl7XG4gICAgICAgIGNhc2UgXCJucG1cIjogXG4gICAgICAgICAgICByZXR1cm4gcHVibGlzaE5wbSgpO1xuICAgICAgICBjYXNlIFwiZG9ja2VyXCI6XG4gICAgICAgICAgICByZXR1cm4gcHVibGlzaERvY2tlcigpO1xuICAgIH1cbn07XG5cbmxldCBwdWJsaXNoTnBtICA9IGZ1bmN0aW9uKCl7XG4gICAgbGV0IGRvbmUgPSBwbHVnaW5zLnEuZGVmZXIoKTtcbiAgICBwcmVwYXJlKFwibnBtXCIpXG4gICAgICAgIC50aGVuKGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICBiYXNoKFwibnBtIHB1Ymxpc2hcIik7XG4gICAgICAgICAgICBwbHVnaW5zLmJlYXV0eWxvZy5vayhcIkRvbmUhXCIpIDtcbiAgICAgICAgICAgIGRvbmUucmVzb2x2ZSgpO1xuICAgICAgICB9KTtcbiAgIHJldHVybiBkb25lLnByb21pc2U7XG59XG5cbmxldCBwdWJsaXNoRG9ja2VyID0gZnVuY3Rpb24oKXtcbiAgICBsZXQgZG9uZSA9IHBsdWdpbnMucS5kZWZlcigpO1xuICAgIHJldHVybiBkb25lLnByb21pc2U7XG59OyJdfQ==
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnB1Ymxpc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDJCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUNsQyxJQUFZLFFBQVEsV0FBTSxhQUFhLENBQUMsQ0FBQTtBQUU3QixlQUFPLEdBQUcsVUFBQyxVQUF5QjtJQUF6QiwwQkFBeUIsR0FBekIsa0JBQX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vbmUhXCIpIDtcbiAgICAgICAgICAgIGRvbmUucmVzb2x2ZSgpO1xuICAgICAgICB9KTtcbiAgIHJldHVybiBkb25lLnByb21pc2U7XG59XG5cbmxldCBwdWJsaXNoRG9ja2VyID0gZnVuY3Rpb24oKXtcbiAgICBsZXQgZG9uZSA9IHBsdWdpbnMucS5kZWZlcigpO1xuICAgIE5wbWNpRW52LmRvY2tlckZpbGVzQnVpbHQuZm9yRWFjaChmdW5jdGlvbihkb2NrZXJmaWxlQXJnKXtcbiAgICAgICAgZG9ja2VyZmlsZUFyZy5wdXNoKCk7XG4gICAgfSk7XG4gICAgcmV0dXJuIGRvbmUucHJvbWlzZTtcbn07XG5cbmxldCBwdWJsaXNoRG9ja2VyVGVzdCA9IGZ1bmN0aW9uKCl7XG4gICAgbGV0IGRvbmUgPSBwbHVnaW5zLnEuZGVmZXIoKTtcbiAgICBOcG1jaUVudi5kb2NrZXJGaWxlc0J1aWx0LmZvckVhY2goZnVuY3Rpb24oZG9ja2VyZmlsZUFyZyl7XG4gICAgICAgIGRvY2tlcmZpbGVBcmcucHVzaCgpO1xuICAgIH0pO1xuICAgIGRvbmUucmVzb2x2ZSgpO1xuICAgIHJldHVybiBkb25lLnByb21pc2U7XG59Il19

View File

@ -26,6 +26,7 @@
"beautylog": "^5.0.8",
"commander": "^2.9.0",
"gulp": "^3.9.1",
"gulp-function": "^1.3.5",
"q": "^1.4.1",
"request": "^2.72.0",
"shelljs": "^0.7.0",

View File

@ -3,28 +3,34 @@ import * as NpmciEnv from "./npmci.env";
export let build = function(){
let done = plugins.q.defer();
done.resolve();
let done = plugins.q.defer();;
plugins.gulp.dest("./Dockerfile*")
.pipe(readDockerfiles)
.pipe(plugins.gulpFunction(done.resolve,"atEnd"));
return done.promise;
}
let readDockerfiles = function(){
plugins.gulp.dest("./Dockerfile*")
.pipe(makeDockerfiles);
};
let makeDockerfiles = function(){
return function(file,enc,cb){
let myDockerfile = new Dockerfile({
filePath:file.path,
read:true
});
NpmciEnv.dockerFiles.push(
new Dockerfile({
filePath:file.path,
read:true
})
myDockerfile
);
cb();
file["Dockerfile"] = myDockerfile;
cb(null,file);
};
}
let buildDockerfiles = function(){
return function(file,enc,cb){
file.myDockerfile.build();
cb();
}
}
export class Dockerfile {
filePath:string;
buildTag:string;
@ -42,9 +48,15 @@ export class Dockerfile {
this.baseImage = dockerBaseImage(this.content);
};
build(){
let tag = dockerTag(this.repo,this.version);
plugins.shelljs.exec("docker build -t " + tag + " -f " + this.filePath + " .");
this.buildTag = tag;
if(!this.buildTag){
let tag = dockerTag(this.repo,this.version);
plugins.shelljs.exec("docker build -t " + tag + " -f " + this.filePath + " .");
this.buildTag = tag;
NpmciEnv.dockerFilesBuilt.push(this);
} else {
plugins.beautylog.error("This Dockerfile already has been built!");
}
};
push(){
if(this.buildTag){

View File

@ -8,6 +8,6 @@ export let dockerTestTag:string;
export let dockerReleaseTag:string;
export let dockerRegistry; // will be set by npmci.prepare
export let dockerImages;
export let dockerFiles:Dockerfile[];
export let dockerFilesBuilt:Dockerfile[] = [];
export let dockerFiles:Dockerfile[] = [];

View File

@ -2,6 +2,7 @@ import "typings-global";
export import beautylog = require("beautylog");
export let commander = require("commander");
export let gulp = require("gulp");
export let gulpFunction = require("gulp-function");
export import path = require("path");
export let q = require("q");
export let request = require("request");

View File

@ -2,7 +2,7 @@ import "typings-global";
import * as plugins from "./npmci.plugins";
import {prepare} from "./npmci.prepare";
import {bash} from "./npmci.bash";
import * as env from "./npmci.env";
import * as NpmciEnv from "./npmci.env";
export let publish = (serviceArg:string = "npm") => {
switch (serviceArg){
@ -26,5 +26,17 @@ let publishNpm = function(){
let publishDocker = function(){
let done = plugins.q.defer();
NpmciEnv.dockerFilesBuilt.forEach(function(dockerfileArg){
dockerfileArg.push();
});
return done.promise;
};
};
let publishDockerTest = function(){
let done = plugins.q.defer();
NpmciEnv.dockerFilesBuilt.forEach(function(dockerfileArg){
dockerfileArg.push();
});
done.resolve();
return done.promise;
}