Skip to content
This repository has been archived by the owner on May 15, 2018. It is now read-only.

Commit

Permalink
Merge pull request #126 from nearform/commit_command
Browse files Browse the repository at this point in the history
removed auto commit from compile and added commit command
  • Loading branch information
mcollina committed May 14, 2015
2 parents fdd8418 + 13967ea commit 8f0e198
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,25 +584,33 @@ module.exports = function(options, loadConfig, logger, _sr, _containers, _servic
if (!systemId) { logger.error(ERR_NOSYSID); return cb(new Error(ERR_NOSYSID)); }

var repoPath = _sr.repoPath(systemId);

_compiler.compile(systemId, repoPath, out, function(err, systems) {
if (err) { return cb(err); }
async.eachSeries(_.keys(systems), function(key, next) {
system = systems[key];
_sr.writeFile(system.id, key + '.json', JSON.stringify(system, null, 2), next);
},
function(err) {
if (err) { return cb(err); }
_sr.commitRevision(user, system.id, comment, function(err, revisionId) {
if (err) { return cb(err); }
cb(null, revisionId);
});
cb(err);
});
});
};



/**
* commit the system
*/
var commitSystem = function(user, identifier, comment, out, cb) {
logger.info('commit system: ' + identifier);
var systemId = _sr.findSystem(identifier);
_sr.commitRevision(user, systemId, comment, function(err, revisionId) {
cb(err, revisionId);
});
};



var monkeyStart = function(user, identifier, target, out, cb) {
_monkey.start(function() { return _monitorRunning; }, analyzeSystem, user, identifier, target, out, function() {
cb(null);
Expand Down Expand Up @@ -687,6 +695,7 @@ module.exports = function(options, loadConfig, logger, _sr, _containers, _servic
unlinkSystem: unlinkSystem,
fixSystem: fixSystem,
compileSystem: compileSystem,
commitSystem: commitSystem,
stopSystem: stopSystem,
infoSystem: infoSystem,

Expand Down

0 comments on commit 8f0e198

Please sign in to comment.