npmci/dist/npmci.build.docker.js
2017-05-15 15:21:56 +02:00

285 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 = [];
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();
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 = (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);
yield npmci_bash_1.bashBare('docker build -t ' + this.buildTag + ' -f ' + this.filePath + ' .');
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.bashBare(`docker tag ${this.buildTag} ${this.releaseTag}`);
yield npmci_bash_1.bashBare(`docker push ${this.releaseTag}`);
// if release registry is different from gitlab
if (NpmciEnv.dockerRegistry !== 'registry.gitlab.com') {
yield npmci_bash_1.bashBare(`docker tag ${this.buildTag} ${this.gitlabReleaseTag}`);
yield npmci_bash_1.bashBare(`docker push ${this.gitlabReleaseTag}`);
}
break;
case 'test':
default:
yield npmci_bash_1.bashBare(`docker tag ${this.buildTag} ${this.gitlabTestTag}`);
yield npmci_bash_1.bashBare(`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.bashBare('docker pull ' + pullTag);
yield npmci_bash_1.bashBare('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.bashBare('docker run --name npmci_test_container ' + this.buildTag + ' mkdir /npmci_test');
yield npmci_bash_1.bashBare('docker cp ' + testFile + ' npmci_test_container:/npmci_test/test.sh');
yield npmci_bash_1.bashBare('docker commit npmci_test_container npmci_test_image');
yield npmci_bash_1.bashBare('docker run npmci_test_image sh /npmci_test/test.sh');
yield npmci_bash_1.bashBare('docker rm npmci_test_container');
yield 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() {
return __awaiter(this, void 0, void 0, function* () {
let containerId = yield npmci_bash_1.bashBare('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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuYnVpbGQuZG9ja2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtY2kuYnVpbGQuZG9ja2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSwyQ0FBMEM7QUFDMUMsdUNBQXNDO0FBQ3RDLHdDQUF1QztBQUN2Qyw2Q0FBdUM7QUFFdkM7O0dBRUc7QUFDUSxRQUFBLEtBQUssR0FBRztJQUNqQixPQUFPLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQywyQkFBMkIsQ0FBQyxDQUFBO0lBQ2xELE1BQU0sdUJBQWUsRUFBRTtTQUNwQixJQUFJLENBQUMsdUJBQWUsQ0FBQztTQUNyQixJQUFJLENBQUMsc0JBQWMsQ0FBQztTQUNwQixJQUFJLENBQUMsd0JBQWdCLENBQUM7U0FDdEIsSUFBSSxDQUFDLHVCQUFlLENBQUMsQ0FBQTtBQUMxQixDQUFDLENBQUEsQ0FBQTtBQUVEOzs7R0FHRztBQUNRLFFBQUEsZUFBZSxHQUFHO0lBQzNCLElBQUksUUFBUSxHQUFHLE1BQU0sT0FBTyxDQUFDLFNBQVMsQ0FBQyxFQUFFLENBQUMsWUFBWSxDQUFDLEtBQUssQ0FBQyxHQUFHLEVBQUUsZUFBZSxDQUFDLENBQUE7SU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