npmci/dist/npmci.build.docker.js
2016-09-20 12:43:37 +02:00

281 lines
20 KiB
JavaScript

"use strict";
const plugins = require("./npmci.plugins");
const paths = require("./npmci.paths");
const NpmciEnv = require("./npmci.env");
const npmci_bash_1 = require("./npmci.bash");
/**
* builds a cwd of Dockerfiles by triggering a promisechain
*/
exports.build = function () {
let done = plugins.q.defer();
exports.readDockerfiles()
.then(exports.sortDockerfiles)
.then(exports.mapDockerfiles)
.then(exports.buildDockerfiles)
.then(exports.pushDockerfiles)
.then(() => {
done.resolve();
});
return done.promise;
};
/**
* creates instance of class Dockerfile for all Dockerfiles in cwd
* @returns Promise<Dockerfile[]>
*/
exports.readDockerfiles = function () {
let done = plugins.q.defer();
let readDockerfilesArray = [];
plugins.gulp.src("./Dockerfile*")
.pipe(plugins.through2.obj(function (file, enc, cb) {
let myDockerfile = new Dockerfile({
filePath: file.path,
read: true
});
readDockerfilesArray.push(myDockerfile);
cb(null, file);
}, function () {
done.resolve(readDockerfilesArray);
}));
return done.promise;
};
/**
* sorts Dockerfiles into a dependency chain
* @param sortableArrayArg an array of instances of class Dockerfile
* @returns Promise<Dockerfile[]>
*/
exports.sortDockerfiles = function (sortableArrayArg) {
let done = plugins.q.defer();
let sortedArray = [];
let cleanTagsOriginal = exports.cleanTagsArrayFunction(sortableArrayArg, sortedArray);
let sorterFunctionCounter = 0;
let sorterFunction = function () {
sortableArrayArg.forEach((dockerfileArg) => {
let cleanTags = exports.cleanTagsArrayFunction(sortableArrayArg, sortedArray);
if (cleanTags.indexOf(dockerfileArg.baseImage) == -1 && sortedArray.indexOf(dockerfileArg) == -1) {
sortedArray.push(dockerfileArg);
}
;
if (cleanTagsOriginal.indexOf(dockerfileArg.baseImage) != -1) {
dockerfileArg.localBaseImageDependent = true;
}
;
});
if (sortableArrayArg.length == sortedArray.length) {
done.resolve(sortedArray);
}
else if (sorterFunctionCounter < 10) {
sorterFunctionCounter++;
sorterFunction();
}
;
};
sorterFunction();
return done.promise;
};
/**
* maps local Dockerfiles dependencies to the correspoding Dockerfile class instances
*/
exports.mapDockerfiles = function (sortedArray) {
let done = plugins.q.defer();
sortedArray.forEach((dockerfileArg) => {
if (dockerfileArg.localBaseImageDependent) {
sortedArray.forEach((dockfile2) => {
if (dockfile2.cleanTag == dockerfileArg.baseImage) {
dockerfileArg.localBaseDockerfile = dockfile2;
}
});
}
;
});
done.resolve(sortedArray);
return done.promise;
};
/**
* builds the correspoding real docker image for each Dockerfile class instance
*/
exports.buildDockerfiles = (sortedArrayArg) => {
let done = plugins.q.defer();
sortedArrayArg.forEach(function (dockerfileArg) {
dockerfileArg.build();
});
done.resolve(sortedArrayArg);
return done.promise;
};
/**
* pushes the real Dockerfile images to a Docker registry
*/
exports.pushDockerfiles = function (sortedArrayArg) {
let done = plugins.q.defer();
sortedArrayArg.forEach(function (dockerfileArg) {
dockerfileArg.push(NpmciEnv.buildStage);
});
done.resolve(sortedArrayArg);
return done.promise;
};
/**
* pulls corresponding real Docker images for instances of Dockerfile from a registry.
* This is needed if building, testing, and publishing of Docker images is carried out in seperate CI stages.
*/
exports.pullDockerfileImages = (sortableArrayArg, registryArg = "registry.gitlab.com") => {
let done = plugins.q.defer();
sortableArrayArg.forEach((dockerfileArg) => {
dockerfileArg.pull(registryArg);
});
done.resolve(sortableArrayArg);
return done.promise;
};
/**
* tests all Dockerfiles in by calling class Dockerfile.test();
* @param sortedArrayArg Dockerfile[] that contains all Dockerfiles in cwd
*/
exports.testDockerfiles = (sortedArrayArg) => {
let done = plugins.q.defer();
sortedArrayArg.forEach(function (dockerfileArg) {
dockerfileArg.test();
});
done.resolve(sortedArrayArg);
return done.promise;
};
/**
* class Dockerfile represents a Dockerfile on disk in npmci
*/
class Dockerfile {
constructor(options) {
this.filePath = options.filePath;
this.repo = NpmciEnv.repo.user + "/" + NpmciEnv.repo.repo;
this.version = exports.dockerFileVersion(plugins.path.parse(options.filePath).base);
this.cleanTag = this.repo + ":" + this.version;
this.buildTag = this.cleanTag;
this.testTag = exports.dockerTag("registry.gitlab.com", this.repo, this.version, "test");
this.releaseTag = exports.dockerTag(NpmciEnv.dockerRegistry, this.repo, this.version);
this.containerName = "dockerfile-" + this.version;
if (options.filePath && options.read) {
this.content = plugins.smartfile.fs.toStringSync(plugins.path.resolve(options.filePath));
}
;
this.baseImage = exports.dockerBaseImage(this.content);
this.localBaseImageDependent = false;
}
;
/**
* builds the Dockerfile
*/
build() {
let done = plugins.q.defer();
plugins.beautylog.info("now building Dockerfile for " + this.cleanTag);
npmci_bash_1.bashBare("docker build -t " + this.buildTag + " -f " + this.filePath + " .");
NpmciEnv.dockerFilesBuilt.push(this);
done.resolve();
return done.promise;
}
;
/**
* pushes the Dockerfile to a registry
*/
push(stageArg) {
let done = plugins.q.defer();
let pushTag;
switch (stageArg) {
case "release":
pushTag = this.releaseTag;
break;
case "test":
default:
pushTag = this.testTag;
break;
}
npmci_bash_1.bashBare("docker tag " + this.buildTag + " " + pushTag);
npmci_bash_1.bashBare("docker push " + pushTag);
done.resolve();
return done.promise;
}
;
/**
* pulls the Dockerfile from a registry
*/
pull(registryArg) {
let pullTag = this.testTag;
npmci_bash_1.bashBare("docker pull " + pullTag);
npmci_bash_1.bashBare("docker tag " + pullTag + " " + this.buildTag);
}
;
/**
* tests the Dockerfile;
*/
test() {
let testFile = plugins.path.join(paths.NpmciTestDir, "test_" + this.version + ".sh");
let testFileExists = plugins.smartfile.fs.fileExistsSync(testFile);
if (testFileExists) {
npmci_bash_1.bashBare("docker run --name npmci_test_container " + this.buildTag + " mkdir /npmci_test");
npmci_bash_1.bashBare("docker cp " + testFile + " npmci_test_container:/npmci_test/test.sh");
npmci_bash_1.bashBare("docker commit npmci_test_container npmci_test_image");
npmci_bash_1.bashBare("docker run npmci_test_image sh /npmci_test/test.sh");
npmci_bash_1.bashBare("docker rm npmci_test_container");
npmci_bash_1.bashBare("docker rmi --force npmci_test_image");
}
else {
plugins.beautylog.warn("skipping tests for " + this.cleanTag + " because no testfile was found!");
}
}
;
/**
* gets the id of a Dockerfile
*/
getId() {
let containerId = npmci_bash_1.bashBare("docker inspect --type=image --format=\"{{.Id}}\" " + this.buildTag);
return containerId;
}
;
}
exports.Dockerfile = Dockerfile;
/**
*
*/
exports.dockerFileVersion = function (dockerfileNameArg) {
let versionString;
let versionRegex = /Dockerfile_([a-zA-Z0-9\.]*)$/;
let regexResultArray = versionRegex.exec(dockerfileNameArg);
if (regexResultArray && regexResultArray.length == 2) {
versionString = regexResultArray[1];
}
else {
versionString = "latest";
}
return versionString;
};
/**
*
*/
exports.dockerBaseImage = function (dockerfileContentArg) {
let baseImageRegex = /FROM\s([a-zA-z0-9\/\-\:]*)\n?/;
let regexResultArray = baseImageRegex.exec(dockerfileContentArg);
return regexResultArray[1];
};
/**
*
*/
exports.dockerTag = function (registryArg, repoArg, versionArg, suffixArg) {
let tagString;
let registry = registryArg;
let repo = repoArg;
let version = versionArg;
if (suffixArg) {
version = versionArg + "_" + suffixArg;
}
;
tagString = registry + "/" + repo + ":" + version;
return tagString;
};
/**
*
*/
exports.cleanTagsArrayFunction = function (dockerfileArrayArg, trackingArrayArg) {
let cleanTagsArray = [];
dockerfileArrayArg.forEach(function (dockerfileArg) {
if (trackingArrayArg.indexOf(dockerfileArg) == -1) {
cleanTagsArray.push(dockerfileArg.cleanTag);
}
});
return cleanTagsArray;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuYnVpbGQuZG9ja2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtY2kuYnVpbGQuZG9ja2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSwyQ0FBMkM7QUFDM0MsdUNBQXVDO0FBQ3ZDLHdDQUF3QztBQUN4Qyw2Q0FBc0M7QUFFdEM7O0dBRUc7QUFDUSxRQUFBLEtBQUssR0FBRztJQUNmLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMs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