From 9c7afba84970c54fd405cdf8b85a017b810563d1 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sun, 5 Jun 2016 05:16:14 +0200 Subject: [PATCH] now building and pushing Dockerfiles with automatic tag recognition --- dist/npmci.build.docker.js | 35 +++++++++++++++++++++---------- dist/npmci.env.d.ts | 2 +- dist/npmci.env.js | 4 +++- dist/npmci.plugins.d.ts | 1 + dist/npmci.plugins.js | 3 ++- dist/npmci.publish.js | 14 ++++++++++++- package.json | 1 + ts/npmci.build.docker.ts | 42 ++++++++++++++++++++++++-------------- ts/npmci.env.ts | 4 ++-- ts/npmci.plugins.ts | 1 + ts/npmci.publish.ts | 16 +++++++++++++-- 11 files changed, 89 insertions(+), 34 deletions(-) diff --git a/dist/npmci.build.docker.js b/dist/npmci.build.docker.js index f785904..26ae75e 100644 --- a/dist/npmci.build.docker.js +++ b/dist/npmci.build.docker.js @@ -3,19 +3,26 @@ var plugins = require("./npmci.plugins"); var NpmciEnv = require("./npmci.env"); exports.build = function () { var done = plugins.q.defer(); - done.resolve(); + ; + plugins.gulp.dest("./Dockerfile*") + .pipe(readDockerfiles) + .pipe(plugins.gulpFunction(done.resolve, "atEnd")); return done.promise; }; var readDockerfiles = function () { - plugins.gulp.dest("./Dockerfile*") - .pipe(makeDockerfiles); -}; -var makeDockerfiles = function () { return function (file, enc, cb) { - NpmciEnv.dockerFiles.push(new Dockerfile({ + var myDockerfile = new Dockerfile({ filePath: file.path, read: true - })); + }); + NpmciEnv.dockerFiles.push(myDockerfile); + file["Dockerfile"] = myDockerfile; + cb(null, file); + }; +}; +var buildDockerfiles = function () { + return function (file, enc, cb) { + file.myDockerfile.build(); cb(); }; }; @@ -32,9 +39,15 @@ var Dockerfile = (function () { } ; Dockerfile.prototype.build = function () { - var tag = exports.dockerTag(this.repo, this.version); - plugins.shelljs.exec("docker build -t " + tag + " -f " + this.filePath + " ."); - this.buildTag = tag; + if (!this.buildTag) { + var tag = exports.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!"); + } }; ; Dockerfile.prototype.push = function () { @@ -80,4 +93,4 @@ exports.dockerTag = function (repoArg, versionArg) { return tagString; }; -//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLmJ1aWxkLmRvY2tlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsSUFBWSxPQUFPLFdBQU0saUJBQ3pCLENBQUMsQ0FEeUM7QUFDMUMsSUFBWSxRQUFRLFdBQU0sYUFBYSxDQUFDLENBQUE7QUFHN0IsYUFBSyxHQUFHO0lBQ2YsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7SUFDZixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztBQUN4QixDQUFDLENBQUE7QUFFRCxJQUFJLGVBQWUsR0FBRztJQUNsQixPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxlQUFlLENBQUM7U0FDN0IsSUFBSSxDQUFDLGVBQWUsQ0FBQyxDQUFDO0FBQy9CLENBQUMsQ0FBQztBQUVGLElBQUksZUFBZSxHQUFHO0lBQ2xCLE1BQU0sQ0FBQyxVQUFTLElBQUksRUFBQyxHQUFHLEVBQUMsRUFBRTtRQUN2QixRQUFRLENBQUMsV0FBVyxDQUFDLElBQUksQ0FDckIsSUFBSSxVQUFVLENBQUM7WUFDWCxRQUFRLEVBQUMsSUFBSSxDQUFDLElBQUk7WUFDbEIsSUFBSSxFQUFDLElBQUk7U0FDWixDQUFDLENBQ0wsQ0FBQztRQUNGLEVBQUUsRUFBRSxDQUFDO0lBQ1QsQ0FBQyxDQUFDO0FBQ04s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3J0IGxldCBkb2NrZXJUYWcgPSBmdW5jdGlvbihyZXBvQXJnOnN0cmluZyx2ZXJzaW9uQXJnOnN0cmluZyk6c3RyaW5ne1xuICAgIGxldCB0YWdTdHJpbmc6c3RyaW5nO1xuICAgIGxldCByZWdpc3RyeSA9IE5wbWNpRW52LmRvY2tlclJlZ2lzdHJ5O1xuICAgIGlmKHByb2Nlc3MuZW52LkNJX0JVSUxEX1NUQUdFID09IFwidGVzdFwiKXtcbiAgICAgICAgcmVnaXN0cnkgPSBcInJlZ2lzdHJ5LmdpdGxhYi5jb21cIjtcbiAgICB9IFxuICAgIGxldCByZXBvID0gcmVwb0FyZztcbiAgICBsZXQgdmVyc2lvbiA9IHZlcnNpb25Bcmc7XG4gICAgaWYocHJvY2Vzcy5lbnYuQ0lfQlVJTERfU1RBR0UgPT0gXCJ0ZXN0XCIgfHwgcHJvY2Vzcy5lbnYuQ0lfQlVJTERfU1RBR0UgPT0gXCJidWlsZFwiKXtcbiAgICAgICAgdmVyc2lvbiA9IHZlcnNpb24gKyBcIl90ZXN0XCI7XG4gICAgfVxuICAgIHRhZ1N0cmluZyA9IHJlZ2lzdHJ5ICsgXCIvXCIgKyByZXBvICsgXCI6XCIgKyB2ZXJzaW9uO1xuICAgIHJldHVybiB0YWdTdHJpbmc7XG59O1xuIl19 diff --git a/dist/npmci.env.d.ts b/dist/npmci.env.d.ts index 7b413fd..c4dce94 100644 --- a/dist/npmci.env.d.ts +++ b/dist/npmci.env.d.ts @@ -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[]; diff --git a/dist/npmci.env.js b/dist/npmci.env.js index 6c369a2..0f2ee64 100644 --- a/dist/npmci.env.js +++ b/dist/npmci.env.js @@ -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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLmVudi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBRXhCLDRCQUFzQixhQUFhLENBQUMsQ0FBQTtBQUd6QixZQUFJLEdBQUcsSUFBSSxxQkFBTyxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsYUFBYSxDQUFDLENBQUM7QUFNckIiLCJmaWxlIjoibnBtY2kuZW52LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIjtcbmltcG9ydCAqIGFzIHBsdWdpbnMgZnJvbSBcIi4vbnBtY2kucGx1Z2luc1wiO1xuaW1wb3J0IHtHaXRSZXBvfSBmcm9tIFwic21hcnRzdHJpbmdcIjtcbmltcG9ydCB7RG9ja2VyZmlsZX0gZnJvbSBcIi4vbnBtY2kuYnVpbGQuZG9ja2VyXCJcblxuZXhwb3J0IGxldCByZXBvID0gbmV3IEdpdFJlcG8ocHJvY2Vzcy5lbnYuQ0lfQlVJTERfUkVQTyk7XG5leHBvcnQgbGV0IGRvY2tlclRlc3RUYWc6c3RyaW5nO1xuZXhwb3J0IGxldCBkb2NrZXJSZWxlYXNlVGFnOnN0cmluZztcblxuZXhwb3J0IGxldCBkb2NrZXJSZWdpc3RyeTsgLy8gd2lsbCBiZSBzZXQgYnkgbnBtY2kucHJlcGFyZVxuZXhwb3J0IGxldCBkb2NrZXJJbWFnZXM7XG5leHBvcnQgbGV0IGRvY2tlckZpbGVzOkRvY2tlcmZpbGVbXTtcblxuIl19 +//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLmVudi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBRXhCLDRCQUFzQixhQUFhLENBQUMsQ0FBQTtBQUd6QixZQUFJLEdBQUcsSUFBSSxxQkFBTyxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsYUFBYSxDQUFDLENBQUM7QUFLOUMsd0JBQWdCLEdBQWdCLEVBQUUsQ0FBQztBQUNuQyxtQkFBVyxHQUFnQixFQUFFLENBQUMiLCJmaWxlIjoibnBtY2kuZW52LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIjtcbmltcG9ydCAqIGFzIHBsdWdpbnMgZnJvbSBcIi4vbnBtY2kucGx1Z2luc1wiO1xuaW1wb3J0IHtHaXRSZXBvfSBmcm9tIFwic21hcnRzdHJpbmdcIjtcbmltcG9ydCB7RG9ja2VyZmlsZX0gZnJvbSBcIi4vbnBtY2kuYnVpbGQuZG9ja2VyXCJcblxuZXhwb3J0IGxldCByZXBvID0gbmV3IEdpdFJlcG8ocHJvY2Vzcy5lbnYuQ0lfQlVJTERfUkVQTyk7XG5leHBvcnQgbGV0IGRvY2tlclRlc3RUYWc6c3RyaW5nO1xuZXhwb3J0IGxldCBkb2NrZXJSZWxlYXNlVGFnOnN0cmluZztcblxuZXhwb3J0IGxldCBkb2NrZXJSZWdpc3RyeTsgLy8gd2lsbCBiZSBzZXQgYnkgbnBtY2kucHJlcGFyZVxuZXhwb3J0IGxldCBkb2NrZXJGaWxlc0J1aWx0OkRvY2tlcmZpbGVbXSA9IFtdO1xuZXhwb3J0IGxldCBkb2NrZXJGaWxlczpEb2NrZXJmaWxlW10gPSBbXTtcblxuIl19 diff --git a/dist/npmci.plugins.d.ts b/dist/npmci.plugins.d.ts index ec32ae9..c9efdde 100644 --- a/dist/npmci.plugins.d.ts +++ b/dist/npmci.plugins.d.ts @@ -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; diff --git a/dist/npmci.plugins.js b/dist/npmci.plugins.js index 88e745b..cecd965 100644 --- a/dist/npmci.plugins.js +++ b/dist/npmci.plugins.js @@ -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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUNWLGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUM7QUFDcEMsaUJBQVMsR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUM7QUFDakMsWUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUNwQixZQUFJLFdBQVcsTUFBTSxDQUFDLENBQUM7QUFDMUIsU0FBQyxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNqQixlQUFPLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDO0FBQzdCLGVBQU8sR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDMUIsZ0JBQVEsV0FBVyxVQUFVLENBQUMsQ0FBQztBQUMvQixtQkFBVyxXQUFXLGFBQWEsQ0FBQyxDQUFDO0FBQ3JDLGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUMiLCJmaWxlIjoibnBtY2kucGx1Z2lucy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGlu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npmci.publish.js index 47d1c57..52911fd 100644 --- a/dist/npmci.publish.js +++ b/dist/npmci.publish.js @@ -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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnB1Ymxpc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDJCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUd2QixlQUFPLEdBQUcsVUFBQyxVQUF5QjtJQUF6QiwwQkFBeUIsR0FBekIsa0JBQXlCO0lBQzNDLE1BQU0sQ0FBQyxDQUFDLFVBQVUsQ0FBQyxDQUFBLENBQUM7UUFDaEIsS0FBSyxLQUFLO1lBQ04sTUFBTSxDQUFDLFVBQVUsRUFBRSxDQUFDO1FBQ3hCLEtBQUssUUFBUTtZQUNULE1BQU0sQ0FBQyxhQUFhLEVBQUUsQ0FBQztJQUMvQixDQUFDO0FBQ0wsQ0FBQyxDQUFDO0FBRUYsSUFBSSxVQUFVLEdBQUk7SUFDZCxJQUFJLElBQ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oRG9ja2VyID0gZnVuY3Rpb24oKXtcbiAgICBsZXQgZG9uZSA9IHBsdWdpbnMucS5kZWZlcigpO1xuICAgIE5wbWNpRW52LmRvY2tlckZpbGVzQnVpbHQuZm9yRWFjaChmdW5jdGlvbihkb2NrZXJmaWxlQXJnKXtcbiAgICAgICAgZG9ja2VyZmlsZUFyZy5wdXNoKCk7XG4gICAgfSk7XG4gICAgcmV0dXJuIGRvbmUucHJvbWlzZTtcbn07XG5cbmxldCBwdWJsaXNoRG9ja2VyVGVzdCA9IGZ1bmN0aW9uKCl7XG4gICAgbGV0IGRvbmUgPSBwbHVnaW5zLnEuZGVmZXIoKTtcbiAgICBOcG1jaUVudi5kb2NrZXJGaWxlc0J1aWx0LmZvckVhY2goZnVuY3Rpb24oZG9ja2VyZmlsZUFyZyl7XG4gICAgICAgIGRvY2tlcmZpbGVBcmcucHVzaCgpO1xuICAgIH0pO1xuICAgIGRvbmUucmVzb2x2ZSgpO1xuICAgIHJldHVybiBkb25lLnByb21pc2U7XG59Il19 diff --git a/package.json b/package.json index c5c46cb..85a58fa 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/ts/npmci.build.docker.ts b/ts/npmci.build.docker.ts index 5a0ee58..672ef23 100644 --- a/ts/npmci.build.docker.ts +++ b/ts/npmci.build.docker.ts @@ -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){ diff --git a/ts/npmci.env.ts b/ts/npmci.env.ts index c4c0e6a..c6e7500 100644 --- a/ts/npmci.env.ts +++ b/ts/npmci.env.ts @@ -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[] = []; diff --git a/ts/npmci.plugins.ts b/ts/npmci.plugins.ts index e0542fd..a734067 100644 --- a/ts/npmci.plugins.ts +++ b/ts/npmci.plugins.ts @@ -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"); diff --git a/ts/npmci.publish.ts b/ts/npmci.publish.ts index 1687769..9481fc6 100644 --- a/ts/npmci.publish.ts +++ b/ts/npmci.publish.ts @@ -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; -}; \ No newline at end of file +}; + +let publishDockerTest = function(){ + let done = plugins.q.defer(); + NpmciEnv.dockerFilesBuilt.forEach(function(dockerfileArg){ + dockerfileArg.push(); + }); + done.resolve(); + return done.promise; +} \ No newline at end of file