npmci/dist/npmci.build.docker.js
2016-11-24 23:21:40 +01: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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuYnVpbGQuZG9ja2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtY2kuYnVpbGQuZG9ja2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSwyQ0FBMEM7QUFDMUMsdUNBQXNDO0FBQ3RDLHdDQUF1QztBQUN2Qyw2Q0FBcUM7QUFFckM7O0dBRUc7QUFDUSxRQUFBLEtBQUssR0FBRztJQUNmLElBQUksSUFBSSxHQUFHLE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