Implemented conditional task

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 11 years ago
parent 26196e94b9
commit d6f965e569
  1. 6
      BuildServer/lib/builder.js
  2. 19
      BuildServer/lib/tasks/conditional.js

@ -40,7 +40,7 @@ var build = function (options, callback) {
}, function(err) { }, function(err) {
if (err) { if (err) {
console.log(err); console.log(err);
return done(err); return done("Git fetch error: " + err);
} }
console.log("Done loading from git"); console.log("Done loading from git");
fs.exists(exported + "/mbs.json", function (exists) { fs.exists(exported + "/mbs.json", function (exists) {
@ -61,6 +61,10 @@ var build = function (options, callback) {
} }
processor.processTask(task, { processor.processTask(task, {
owner: owner,
reponame: reponame,
branch: branch,
rev: rev,
tmp: tmp, tmp: tmp,
exported: exported, exported: exported,
release: release release: release

@ -0,0 +1,19 @@
"use strict";
module.exports = function (params, processor) {
return {
process: function () {
if (params.owner && params.owner != processor.context.owner) {
return processor.done();
}
if (params.branch && params.branch != processor.context.branch) {
return processor.done();
}
processor.processTask(params.task, function () {
processor.done();
});
}
};
};
Loading…
Cancel
Save