npmci/dist/npmci.build.docker.js
2017-05-15 18:10:24 +02:00

291 lines
21 KiB
JavaScript

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
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 = () => __awaiter(this, void 0, void 0, function* () {
plugins.beautylog.log('now building Dockerfiles...');
yield exports.readDockerfiles()
.then(exports.sortDockerfiles)
.then(exports.mapDockerfiles)
.then(exports.buildDockerfiles)
.then(exports.pushDockerfiles);
});
/**
* creates instance of class Dockerfile for all Dockerfiles in cwd
* @returns Promise<Dockerfile[]>
*/
exports.readDockerfiles = () => __awaiter(this, void 0, void 0, function* () {
let fileTree = yield plugins.smartfile.fs.listFileTree(paths.cwd, 'Dockerfile*');
// create the Dockerfile array
let readDockerfilesArray = [];
plugins.beautylog.info(`found ${fileTree.length} Dockerfiles:`);
console.log(fileTree);
for (let dockerfilePath of fileTree) {
let myDockerfile = new Dockerfile({
filePath: dockerfilePath,
read: true
});
readDockerfilesArray.push(myDockerfile);
}
return readDockerfilesArray;
});
/**
* sorts Dockerfiles into a dependency chain
* @param sortableArrayArg an array of instances of class Dockerfile
* @returns Promise<Dockerfile[]>
*/
exports.sortDockerfiles = (sortableArrayArg) => {
let done = plugins.q.defer();
plugins.beautylog.info('sorting Dockerfiles:');
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) {
let counter = 1;
for (let dockerfile of sortedArray) {
plugins.beautylog.log(`tag ${counter}: -> ${dockerfile.cleanTag}`);
counter++;
}
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 = (sortedArray) => __awaiter(this, void 0, void 0, function* () {
sortedArray.forEach((dockerfileArg) => {
if (dockerfileArg.localBaseImageDependent) {
sortedArray.forEach((dockfile2) => {
if (dockfile2.cleanTag === dockerfileArg.baseImage) {
dockerfileArg.localBaseDockerfile = dockfile2;
}
});
}
;
});
return sortedArray;
});
/**
* builds the correspoding real docker image for each Dockerfile class instance
*/
exports.buildDockerfiles = (sortedArrayArg) => __awaiter(this, void 0, void 0, function* () {
for (let dockerfileArg of sortedArrayArg) {
yield dockerfileArg.build();
}
return sortedArrayArg;
});
/**
* pushes the real Dockerfile images to a Docker registry
*/
exports.pushDockerfiles = (sortedArrayArg) => __awaiter(this, void 0, void 0, function* () {
for (let dockerfileArg of sortedArrayArg) {
yield dockerfileArg.push(NpmciEnv.buildStage);
}
return sortedArrayArg;
});
/**
* 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') => __awaiter(this, void 0, void 0, function* () {
for (let dockerfileArg of sortableArrayArg) {
yield dockerfileArg.pull(registryArg);
}
return sortableArrayArg;
});
/**
* tests all Dockerfiles in by calling class Dockerfile.test();
* @param sortedArrayArg Dockerfile[] that contains all Dockerfiles in cwd
*/
exports.testDockerfiles = (sortedArrayArg) => __awaiter(this, void 0, void 0, function* () {
for (let dockerfileArg of sortedArrayArg) {
yield dockerfileArg.test();
}
return sortedArrayArg;
});
/**
* 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.gitlabTestTag = exports.dockerTag('registry.gitlab.com', this.repo, this.version, 'test');
this.gitlabReleaseTag = exports.dockerTag('registry.gitlab.com', this.repo, this.version);
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() {
return __awaiter(this, void 0, void 0, function* () {
plugins.beautylog.info('now building Dockerfile for ' + this.cleanTag);
let buildCommand = `docker build -t ${this.buildTag} -f ${this.filePath} .`;
yield npmci_bash_1.bash(buildCommand);
NpmciEnv.dockerFilesBuilt.push(this);
return;
});
}
;
/**
* pushes the Dockerfile to a registry
*/
push(stageArg) {
return __awaiter(this, void 0, void 0, function* () {
switch (stageArg) {
case 'release':
yield npmci_bash_1.bash(`docker tag ${this.buildTag} ${this.releaseTag}`);
yield npmci_bash_1.bash(`docker push ${this.releaseTag}`);
// if release registry is different from gitlab
if (NpmciEnv.dockerRegistry !== 'registry.gitlab.com') {
yield npmci_bash_1.bash(`docker tag ${this.buildTag} ${this.gitlabReleaseTag}`);
yield npmci_bash_1.bash(`docker push ${this.gitlabReleaseTag}`);
}
break;
case 'test':
default:
yield npmci_bash_1.bash(`docker tag ${this.buildTag} ${this.gitlabTestTag}`);
yield npmci_bash_1.bash(`docker push ${this.gitlabTestTag}`);
break;
}
});
}
;
/**
* pulls the Dockerfile from a registry
*/
pull(registryArg) {
return __awaiter(this, void 0, void 0, function* () {
let pullTag = this.gitlabTestTag;
yield npmci_bash_1.bash('docker pull ' + pullTag);
yield npmci_bash_1.bash('docker tag ' + pullTag + ' ' + this.buildTag);
});
}
;
/**
* tests the Dockerfile;
*/
test() {
return __awaiter(this, void 0, void 0, function* () {
let testFile = plugins.path.join(paths.NpmciTestDir, 'test_' + this.version + '.sh');
let testFileExists = plugins.smartfile.fs.fileExistsSync(testFile);
if (testFileExists) {
// run tests
yield npmci_bash_1.bash('docker run --name npmci_test_container ' + this.buildTag + ' mkdir /npmci_test');
yield npmci_bash_1.bash('docker cp ' + testFile + ' npmci_test_container:/npmci_test/test.sh');
yield npmci_bash_1.bash('docker commit npmci_test_container npmci_test_image');
yield npmci_bash_1.bash('docker run npmci_test_image sh /npmci_test/test.sh');
yield npmci_bash_1.bash('docker rm npmci_test_container');
yield npmci_bash_1.bash('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() {
return __awaiter(this, void 0, void 0, function* () {
let containerId = yield npmci_bash_1.bash('docker inspect --type=image --format=\"{{.Id}}\" ' + this.buildTag);
return containerId;
});
}
;
}
exports.Dockerfile = Dockerfile;
/**
* returns a version for a docker file
* @execution SYNC
*/
exports.dockerFileVersion = (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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuYnVpbGQuZG9ja2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtY2kuYnVpbGQuZG9ja2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSwyQ0FBMEM7QUFDMUMsdUNBQXNDO0FBQ3RDLHdDQUF1QztBQUN2Qyw2Q0FBbUM7QUFFbkM7O0dBRUc7QUFDUSxRQUFBLEtBQUssR0FBRztJQUNqQixPQUFPLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQyw2QkFBNkIsQ0FBQyxDQUFBO0lBQ3BELE1BQU0sdUJBQWUsRUFBRTtTQUNwQixJQUFJLENBQUMsdUJBQWUsQ0FBQztTQUNyQixJQUFJLENBQUMsc0JBQWMsQ0FBQztTQUNwQixJQUFJLENBQUMsd0JBQWdCLENBQUM7U0FDdEIsSUFBSSxDQUFDLHVCQUFlLENBQUMsQ0FBQTtBQUMxQixDQUFDLENBQUEsQ0FBQTtBQUVEOzs7R0FHRztBQUNRLFFBQUEsZUFBZSxHQUFHO0lBQzNCLElBQUksUUFBUSxHQU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