43 lines
3.2 KiB
JavaScript
43 lines
3.2 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 npmci_bash_1 = require("./npmci.bash");
|
|
const npmci_install_1 = require("./npmci.install");
|
|
const NpmciBuildDocker = require("./npmci.build.docker");
|
|
exports.test = (versionArg) => __awaiter(this, void 0, void 0, function* () {
|
|
if (versionArg === 'docker') {
|
|
yield testDocker();
|
|
}
|
|
else {
|
|
yield npmci_install_1.install(versionArg)
|
|
.then(npmDependencies)
|
|
.then(npmTest);
|
|
}
|
|
});
|
|
let npmDependencies = () => __awaiter(this, void 0, void 0, function* () {
|
|
plugins.beautylog.info('now installing dependencies:');
|
|
if (yield npmci_bash_1.yarnAvailable.promise) {
|
|
yield npmci_bash_1.bash('yarn install');
|
|
}
|
|
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');
|
|
});
|
|
let testDocker = () => __awaiter(this, void 0, void 0, function* () {
|
|
return yield NpmciBuildDocker.readDockerfiles()
|
|
.then(NpmciBuildDocker.pullDockerfileImages)
|
|
.then(NpmciBuildDocker.testDockerfiles);
|
|
});
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kudGVzdC5qcyIsInNvdXJjZVJvb3QiOi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