npmci/dist/mod_docker/mod.builddocker.js

293 lines
22 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("./mod.plugins");
const paths = require("../npmci.paths");
const NpmciEnv = require("../npmci.env");
const npmci_bash_1 = require("../npmci.bash");
let modArgvArg; // will be set through the build command
/**
* builds a cwd of Dockerfiles by triggering a promisechain
*/
exports.build = (argvArg) => __awaiter(this, void 0, void 0, function* () {
modArgvArg = argvArg;
plugins.beautylog.log('now building Dockerfiles...');
yield exports.readDockerfiles(argvArg)
.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 = (argvArg) => __awaiter(this, void 0, void 0, function* () {
modArgvArg = argvArg;
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* () {
let stageArg = (function () {
if (modArgvArg._ && modArgvArg._.length >= 3) {
return modArgvArg._[2];
}
else {
return NpmciEnv.buildStage;
}
})();
for (let dockerfileArg of sortedArrayArg) {
yield dockerfileArg.push(stageArg);
}
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;
};
/**
* returns the docker base image for a Dockerfile
*/
exports.dockerBaseImage = function (dockerfileContentArg) {
let baseImageRegex = /FROM\s([a-zA-z0-9\/\-\:]*)\n?/;
let regexResultArray = baseImageRegex.exec(dockerfileContentArg);
return regexResultArray[1];
};
/**
* returns the docker tag
*/
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kLmJ1aWxkZG9ja2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvbW9kX2RvY2tlci9tb2QuYnVpbGRkb2NrZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLHlDQUF3QztBQUN4Qyx3Q0FBdUM7QUFDdkMseUNBQXdDO0FBQ3hDLDhDQUFvQztBQUVwQyxJQUFJLFVBQVUsQ0FBQSxDQUFDLHdDQUF3QztBQUV2RDs7R0FFRztBQUNRLFFBQUEsS0FBSyxHQUFHLENBQU8sT0FBWTtJQUNwQyxVQUFVLEdBQUcsT0FBTyxDQUFBO0lBQ3BCLE9BQU8sQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLDZCQUE2QixDQUFDLENBQUE7SUFDcEQsTUFBTSx1QkFBZSxDQUFDLE9BQU8sQ0FBQztTQUMzQixJQUFJ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