kopia lustrzana https://github.com/OpenDroneMap/NodeODM
Added powercycle option, travis file
rodzic
74ecbcc0cc
commit
b5d33166d9
|
@ -0,0 +1,14 @@
|
||||||
|
sudo: required
|
||||||
|
|
||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- "7"
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- docker built -t opendronemap/node-opendronemap .
|
||||||
|
- docker run opendronemap/node-opendronemap /bin/sh -c "cd /var/www; node index.js --powercycle"
|
||||||
|
|
||||||
|
script: node index.js --powercycle
|
|
@ -35,6 +35,7 @@ Options:
|
||||||
--cleanup_tasks_after <number> Number of days that elapse before deleting finished and canceled tasks (default: 3)
|
--cleanup_tasks_after <number> Number of days that elapse before deleting finished and canceled tasks (default: 3)
|
||||||
--test Enable test mode. In test mode, no commands are sent to OpenDroneMap. This can be useful during development or testing (default: false)
|
--test Enable test mode. In test mode, no commands are sent to OpenDroneMap. This can be useful during development or testing (default: false)
|
||||||
--test_skip_orthophotos If test mode is enabled, skip orthophoto results when generating assets. (default: false)
|
--test_skip_orthophotos If test mode is enabled, skip orthophoto results when generating assets. (default: false)
|
||||||
|
--powercycle When set, the application exits immediately after powering up. Useful for testing launch and compilation issues.
|
||||||
Log Levels:
|
Log Levels:
|
||||||
error | debug | info | verbose | debug | silly
|
error | debug | info | verbose | debug | silly
|
||||||
`);
|
`);
|
||||||
|
@ -80,5 +81,6 @@ config.parallelQueueProcessing = argv.parallel_queue_processing || fromConfigFil
|
||||||
config.cleanupTasksAfter = argv.cleanup_tasks_after || fromConfigFile("cleanupTasksAfter", 3);
|
config.cleanupTasksAfter = argv.cleanup_tasks_after || fromConfigFile("cleanupTasksAfter", 3);
|
||||||
config.test = argv.test || fromConfigFile("test", false);
|
config.test = argv.test || fromConfigFile("test", false);
|
||||||
config.testSkipOrthophotos = argv.test_skip_orthophotos || fromConfigFile("testSkipOrthophotos", false);
|
config.testSkipOrthophotos = argv.test_skip_orthophotos || fromConfigFile("testSkipOrthophotos", false);
|
||||||
|
config.powercycle = argv.powercycle || fromConfigFile("powercycle", false);
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
|
|
14
index.js
14
index.js
|
@ -515,7 +515,7 @@ process.on ('SIGINT', gracefulShutdown);
|
||||||
// Startup
|
// Startup
|
||||||
if (config.test) logger.info("Running in test mode");
|
if (config.test) logger.info("Running in test mode");
|
||||||
|
|
||||||
async.series([
|
let commands = [
|
||||||
cb => odmOptions.initialize(cb),
|
cb => odmOptions.initialize(cb),
|
||||||
cb => { taskManager = new TaskManager(cb); },
|
cb => { taskManager = new TaskManager(cb); },
|
||||||
cb => { server = app.listen(config.port, err => {
|
cb => { server = app.listen(config.port, err => {
|
||||||
|
@ -523,7 +523,15 @@ async.series([
|
||||||
cb(err);
|
cb(err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
], err => {
|
];
|
||||||
debugger;
|
|
||||||
|
if (config.powercycle){
|
||||||
|
commands.push(cb => {
|
||||||
|
logger.info("Power cycling is set, application will shut down...");
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async.series(commands, err => {
|
||||||
if (err) logger.error("Error during startup: " + err.message);
|
if (err) logger.error("Error during startup: " + err.message);
|
||||||
});
|
});
|
||||||
|
|
Ładowanie…
Reference in New Issue