2017-05-19 10:09:33 +00:00
|
|
|
"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 npmci_bash_1 = require("../npmci.bash");
|
|
|
|
const npmciMods = require("../npmci.mods");
|
|
|
|
let npmDependencies = () => __awaiter(this, void 0, void 0, function* () {
|
|
|
|
plugins.beautylog.info('now installing dependencies:');
|
|
|
|
if (yield npmci_bash_1.yarnAvailable.promise) {
|
2017-06-30 21:33:56 +00:00
|
|
|
yield npmci_bash_1.bash('yarn install');
|
2017-05-19 10:09:33 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
yield npmci_bash_1.bash('npm install');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
let npmTest = () => __awaiter(this, void 0, void 0, function* () {
|
|
|
|
plugins.beautylog.info('now starting tests:');
|
|
|
|
yield npmci_bash_1.bash('npm test');
|
|
|
|
});
|
2017-07-27 12:20:56 +00:00
|
|
|
let testDocker = (argvArg) => __awaiter(this, void 0, void 0, function* () {
|
2017-05-19 10:09:33 +00:00
|
|
|
let modDocker = yield npmciMods.modDocker.load();
|
2017-07-27 12:20:56 +00:00
|
|
|
return yield modDocker.readDockerfiles(argvArg)
|
2017-05-19 10:09:33 +00:00
|
|
|
.then(modDocker.pullDockerfileImages)
|
|
|
|
.then(modDocker.testDockerfiles);
|
|
|
|
});
|
|
|
|
/**
|
|
|
|
* the main test function
|
|
|
|
* @param versionArg
|
|
|
|
*/
|
2017-07-27 12:20:56 +00:00
|
|
|
exports.test = (argvArg) => __awaiter(this, void 0, void 0, function* () {
|
|
|
|
let whatToTest = argvArg._[1];
|
|
|
|
if (whatToTest === 'docker') {
|
|
|
|
yield testDocker(argvArg);
|
2017-05-19 10:09:33 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
let modInstall = yield npmciMods.modInstall.load();
|
2017-07-27 12:20:56 +00:00
|
|
|
yield modInstall.install(whatToTest)
|
2017-05-19 10:09:33 +00:00
|
|
|
.then(npmDependencies)
|
|
|
|
.then(npmTest);
|
|
|
|
}
|
|
|
|
});
|
2017-07-27 12:20:56 +00:00
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9tb2RfdGVzdC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEseUNBQXdDO0FBQ3hDLDhDQUFtRDtBQUVuRCwyQ0FBMEM7QUFLMUMsSUFBSSxlQUFlLEdBQUc7SUFDcEIsT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsOEJBQThCLENBQUMsQ0FBQTtJQUN0RCxFQUFFLENBQUMsQ0FBQyxNQUFNLDBCQUFhLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQztRQUNoQyxNQUFNLGlCQUFJLENBQUMsY0FBYyxDQUFDLENBQUE7SUFDNUIsQ0FBQztJQUFDLElBQUksQ0FBQyxDQUFDO1FBQ04sTUFBTSxpQkFBSSxDQUFDLGFBQWEsQ0FBQyxDQUFBO0lBQzNCLENBQUM7QUFDSCxDQUFDLENBQUEsQ0FBQTtBQUVELElBQUksT0FBTyxHQUFHO0lBQ1osT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMscUJBQXFCLENBQUMsQ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