37 lines
2.8 KiB
JavaScript
37 lines
2.8 KiB
JavaScript
"use strict";
|
|
const plugins = require("./npmdocker.plugins");
|
|
const paths = require("./npmdocker.paths");
|
|
;
|
|
let getQenvKeyValueObject = () => {
|
|
let done = plugins.q.defer();
|
|
let qenvKeyValueObjectArray;
|
|
if (plugins.smartfile.fs.fileExistsSync(plugins.path.join(paths.cwd, 'qenv.yml'))) {
|
|
qenvKeyValueObjectArray = new plugins.qenv.Qenv(paths.cwd, '.nogit/').keyValueObjectArray;
|
|
}
|
|
else {
|
|
qenvKeyValueObjectArray = [];
|
|
}
|
|
;
|
|
done.resolve(qenvKeyValueObjectArray);
|
|
return done.promise;
|
|
};
|
|
let buildConfig = (qenvKeyValueObjectArrayArg) => {
|
|
let done = plugins.q.defer();
|
|
let npmextra = new plugins.npmextra.Npmextra(paths.cwd);
|
|
let config = npmextra.dataFor('npmdocker', {
|
|
baseImage: 'hosttoday/ht-docker-node:npmts',
|
|
command: 'npm test',
|
|
dockerSock: false,
|
|
keyValueObjectArray: qenvKeyValueObjectArrayArg
|
|
});
|
|
done.resolve(config);
|
|
return done.promise;
|
|
};
|
|
exports.run = () => {
|
|
let done = plugins.q.defer();
|
|
getQenvKeyValueObject()
|
|
.then(buildConfig)
|
|
.then(done.resolve);
|
|
return done.promise;
|
|
};
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZG9ja2VyLmNvbmZpZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWRvY2tlci5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtDQUE4QztBQUM5QywyQ0FBMEM7QUFXekMsQ0FBQztBQUVGLElBQUkscUJBQXFCLEdBQUc7SUFDMUIsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQTtJQUM1QixJQUFJLHVCQUEwQy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