Skip to content

Commit

Permalink
Fixed for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
itayw committed Sep 22, 2013
1 parent 8baecbc commit d461394
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
33 changes: 30 additions & 3 deletions build/dev-deploy.js
Expand Up @@ -6,8 +6,8 @@ var
logger.info('Starting build development environment deploy script...');

var basePath = path.join(__dirname + '/..');
var targetDirectory = path.join(basePath + '/../joola-analytics/node_modules/joola-sdk', '/bin/joola.js');
var serverDirectory = path.join(basePath + '/../algonode-server/node_modules/joola-analytics/node_modules/joola-sdk', '/bin/joola.js');
var targetDirectory = path.join(basePath + '/../joola.io.analytics/node_modules/joola.io.sdk', '/bin/joola.js');
var serverDirectory = path.join(basePath + '/../joola.io/node_modules/joola.io.sdk', '/bin/joola.js');

var sourceFile = path.join(basePath + '/bin/joola.js');

Expand Down Expand Up @@ -55,4 +55,31 @@ prc.on('close', function (code) {
fork(calls, function () {
logger.info('Build script finished');
})
});
});


//ncp.limit = 10;
var options = {
filter: function (filename) {
return filename.indexOf('git') == -1 && filename.indexOf('.idea') == -1 && filename.indexOf('node_modules');
}
};

var targetDirectory = path.join(basePath + '/../joola.io.analytics/node_modules/joola.io.sdk');
ncp(basePath, targetDirectory, options, function (err) {
if (err)
logger.error('Failed: ' + err);
else
logger.info('...Files copied');
logger.info('Build script finished');
});

var targetDirectory = path.join(basePath + '/../joola.io/node_modules/joola.io.sdk');
ncp(basePath, targetDirectory, options, function (err) {
if (err)
logger.error('Failed: ' + err);
else
logger.info('...Files copied');
logger.info('Build script finished');
});

6 changes: 3 additions & 3 deletions joola.io.sdk.js
Expand Up @@ -61,13 +61,13 @@ var httpServer, httpsServer;
var startHTTP = function (callback) {
var result = {};
try {
var _httpServer = http.createServer(app).listen(joola.config.general.port || 80,function (err) {
var _httpServer = http.createServer(app).listen(joola.config.general.port || 42112,function (err) {
if (err) {
result.status = 'Failed: ' + ex.message;
return callback(result);
}
status = 'Running';
logger.info('Joola Analytics HTTP server listening on port ' + joola.config.general.port || 80);
logger.info('Joola Analytics HTTP server listening on port ' + joola.config.general.port || 42112);
result.status = 'Success';
httpServer = _httpServer;
return callback(result);
Expand All @@ -76,7 +76,7 @@ var startHTTP = function (callback) {
return callback(result);
}).on('close', function () {
status = 'Stopped';
logger.warn('Joola Analytics HTTP server listening on port ' + (joola.config.general.port || 80).toString() + ' received a CLOSE command.');
logger.warn('Joola Analytics HTTP server listening on port ' + (joola.config.general.port || 42112).toString() + ' received a CLOSE command.');
});
}
catch (ex) {
Expand Down
3 changes: 1 addition & 2 deletions lib/shared/logger.js
Expand Up @@ -38,8 +38,7 @@ else {
var output = '[' + process.pid + '] ' + utils.formatDate(new Date(), 'yyyy-mm-dd hh:nn:ss', false) + ', ' + (new Date().getTime() - tsStart).toString() + ' ms, ' + (new Date().getTime() - lastLog.getTime()) + ' ms';
lastLog = new Date();
return output;
} }),
new winston.transports.File({ level: 'debug', filename: logDir + '/' + global.loggername + '.log', json: false, maxsize: 10000000 })
} })
],
exitOnError: false
});
Expand Down

0 comments on commit d461394

Please sign in to comment.