2016-05-30 00:29:30 +00:00
|
|
|
"use strict";
|
|
|
|
require("typings-global");
|
2016-07-18 14:56:53 +00:00
|
|
|
const plugins = require("./npmci.plugins");
|
|
|
|
const npmci_bash_1 = require("./npmci.bash");
|
|
|
|
const npmci_install_1 = require("./npmci.install");
|
|
|
|
const NpmciBuildDocker = require("./npmci.build.docker");
|
|
|
|
exports.test = (versionArg) => {
|
|
|
|
let done = plugins.q.defer();
|
2016-06-03 22:10:19 +00:00
|
|
|
if (versionArg == "docker") {
|
|
|
|
testDocker()
|
2016-07-18 14:56:53 +00:00
|
|
|
.then(() => {
|
2016-06-03 22:10:19 +00:00
|
|
|
done.resolve();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
npmci_install_1.install(versionArg)
|
|
|
|
.then(npmDependencies)
|
2016-06-07 02:31:25 +00:00
|
|
|
.then(npmTest)
|
2016-07-18 14:56:53 +00:00
|
|
|
.then(() => {
|
2016-06-03 22:10:19 +00:00
|
|
|
done.resolve();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
return done.promise;
|
|
|
|
};
|
2016-07-18 14:56:53 +00:00
|
|
|
let npmDependencies = function () {
|
|
|
|
let done = plugins.q.defer();
|
2016-06-03 22:10:19 +00:00
|
|
|
plugins.beautylog.info("now installing dependencies:");
|
|
|
|
npmci_bash_1.bash("npm install");
|
|
|
|
done.resolve();
|
|
|
|
return done.promise;
|
|
|
|
};
|
2016-07-18 14:56:53 +00:00
|
|
|
let npmTest = () => {
|
|
|
|
let done = plugins.q.defer();
|
2016-06-07 02:31:25 +00:00
|
|
|
plugins.beautylog.info("now starting tests:");
|
|
|
|
npmci_bash_1.bash("npm test");
|
2016-06-03 22:10:19 +00:00
|
|
|
done.resolve();
|
2016-05-30 00:29:30 +00:00
|
|
|
return done.promise;
|
|
|
|
};
|
2016-07-18 14:56:53 +00:00
|
|
|
let testDocker = function () {
|
|
|
|
let done = plugins.q.defer();
|
2016-06-07 02:31:25 +00:00
|
|
|
NpmciBuildDocker.readDockerfiles()
|
|
|
|
.then(NpmciBuildDocker.pullDockerfileImages)
|
|
|
|
.then(NpmciBuildDocker.testDockerfiles)
|
|
|
|
.then(done.resolve);
|
|
|
|
return done.promise;
|
|
|
|
};
|
2016-07-18 14:56:53 +00:00
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kudGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLnRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixNQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDZCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUNsQyxnQ0FBc0IsaUJBQWlCLENBQUMsQ0FBQTtBQUV4QyxNQUFZLGdCQUFnQixXQUFNLHNCQUFzQixDQUFDLENBQUE7QUFFOUMsWUFBSSxHQUFHLENBQUMsVUFBVTtJQUN6QixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLEVBQUUsQ0FBQSxDQUFDLFVBQVUsSUFBSSxRQUFRLENBQUMsQ0FBQSxDQUFDO1FBQ3ZCLFVBQVUsRUFBRTthQUNQLElBQUksQ0FBQztZQUNGLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztRQUNuQixDQUFDLENBQUMsQ0FBQztJQUNYLENBQUM7SUFBQyxJQUFJLENBQUMsQ0FBQztRQUNKLHVCQUFPLENBQUMsVUFBVSxDQUFDO2FBQ2QsSUFBSSxDQUFDLGVBQWUsQ0FBQzthQUNyQixJQUFJLENBQUMsT0FBTyxDQUFDO2FBQ2IsSUFBSSxDQUFDO1lBQ0YsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO1FBQ25CLENBQUMsQ0FBQy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