2016-07-18 22:37:13 +00:00
|
|
|
"use strict";
|
2017-03-28 23:01:37 +00:00
|
|
|
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 });
|
2016-07-18 22:37:13 +00:00
|
|
|
const plugins = require("./npmdocker.plugins");
|
2016-08-04 20:25:15 +00:00
|
|
|
const paths = require("./npmdocker.paths");
|
2017-03-28 23:01:37 +00:00
|
|
|
let getQenvKeyValueObject = () => __awaiter(this, void 0, void 0, function* () {
|
2016-08-04 20:25:15 +00:00
|
|
|
let qenvKeyValueObjectArray;
|
2017-02-11 19:23:10 +00:00
|
|
|
if (plugins.smartfile.fs.fileExistsSync(plugins.path.join(paths.cwd, 'qenv.yml'))) {
|
|
|
|
qenvKeyValueObjectArray = new plugins.qenv.Qenv(paths.cwd, '.nogit/').keyValueObjectArray;
|
2016-07-19 17:21:06 +00:00
|
|
|
}
|
2016-08-04 20:25:15 +00:00
|
|
|
else {
|
|
|
|
qenvKeyValueObjectArray = [];
|
|
|
|
}
|
2017-03-28 23:01:37 +00:00
|
|
|
return qenvKeyValueObjectArray;
|
|
|
|
});
|
|
|
|
let buildConfig = (qenvKeyValueObjectArrayArg) => __awaiter(this, void 0, void 0, function* () {
|
2017-02-11 19:23:10 +00:00
|
|
|
let npmextra = new plugins.npmextra.Npmextra(paths.cwd);
|
|
|
|
let config = npmextra.dataFor('npmdocker', {
|
2017-10-13 16:06:12 +00:00
|
|
|
baseImage: 'hosttoday/ht-docker-node:npmdocker',
|
|
|
|
init: 'rm -rf node_nodules/ && yarn install',
|
|
|
|
command: 'npmci npm test',
|
2017-02-11 19:23:10 +00:00
|
|
|
dockerSock: false,
|
|
|
|
keyValueObjectArray: qenvKeyValueObjectArrayArg
|
2016-08-04 20:25:15 +00:00
|
|
|
});
|
2017-03-28 23:01:37 +00:00
|
|
|
return config;
|
|
|
|
});
|
|
|
|
exports.run = () => __awaiter(this, void 0, void 0, function* () {
|
|
|
|
let config = yield getQenvKeyValueObject().then(buildConfig);
|
|
|
|
return config;
|
|
|
|
});
|
2018-05-18 11:09:14 +00:00
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZG9ja2VyLmNvbmZpZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWRvY2tlci5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLCtDQUErQztBQUMvQywyQ0FBMkM7QUFhM0MsSUFBSSxxQkFBcUIsR0FBRyxHQUFTLEVBQUU7SUFDckMsSUFBSSx1QkFBMEMsQ0FBQztJQUMvQyxJQUFJLE9BQU8sQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLGNBQWMsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsR0FBRyxFQUFFLFVBQVUsQ0FBQyxDQUFDLEVBQUU7UUFDakYsdUJBQXVCLEdBQUcsSUFBSSxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsR0FBRyxFQUFFLFNBQVMsQ0FBQyxDQUFDLG1CQUFtQixDQUFDO0tBQzNGO1NBQU07UUFDTCx1QkFBdUIsR0FBRyxFQUFFLENBQUM7S0FDOUI7SUFDRCxPQUFPLHVCQUF1QixDQUFDO0FBQ2pDLENBQUMsQ0FBQSxDQUFDO0FBRUYsSUFBS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