Adding additional Start Command

This commit is contained in:
Martin Karkowski 2021-07-29 15:27:35 +02:00
parent 28291e3b8e
commit 36bfe36467
5 changed files with 31 additions and 9 deletions

View File

@ -2,4 +2,4 @@ set DIR=%~dp0
cd "%DIR%" cd "%DIR%"
git clone --branch dev https://info.system:ZeMA123$@git.zema.de/tfs/ZISS/_git/ZISS-Kernel-2.0 git clone --branch dev https://info.system:ZeMA123$@git.zema.de/tfs/ZISS/_git/ZISS-Kernel-2.0
cd ZISS-Kernel-2.0 cd ZISS-Kernel-2.0
call ./00-install.bat call ./07-WAMO-Update.bat

View File

@ -57,12 +57,12 @@ node .\dist\lib\cli\ioServerService.js -m install
@REM now reinstall the services @REM now reinstall the services
@REM Install all Services @REM Install all Services
for /f "delims=" %%a in ('dir /s /o /b *01-install.bat') do ( for /f "delims=" %%a in ('dir /s /o /b *00-install.bat') do (
echo %%a echo %%a
call %%a call %%a
) )
@REM Start all Services @REM Start all Services
for /f "delims=" %%a in ('dir /s /o /b *02-restart.bat') do ( for /f "delims=" %%a in ('dir /s /o /b *01-start.bat') do (
echo %%a echo %%a
call %%a call %%a
) )

View File

@ -314,7 +314,7 @@ export async function createService(
) )
}, },
{ {
name: "01-install.bat", name: "00-install.bat",
render: handlebars.compile(`set DIR=%~dp0 render: handlebars.compile(`set DIR=%~dp0
cd "%DIR%" cd "%DIR%"
cd .. cd ..
@ -323,6 +323,16 @@ cd ..
node {{{pathToFolder}}}\\service.js -m install node {{{pathToFolder}}}\\service.js -m install
`) `)
}, },
{
name: "01-start.bat",
render: handlebars.compile(`set DIR=%~dp0
cd "%DIR%"
cd ..
cd ..
cd ..
node {{{pathToFolder}}}\\service.js -m start
`)
},
{ {
name: "02-restart.bat", name: "02-restart.bat",
render: handlebars.compile(`set DIR=%~dp0 render: handlebars.compile(`set DIR=%~dp0

View File

@ -95,7 +95,7 @@ switch (parser.parseArgs().mode) {
// process is available as a service. // process is available as a service.
svc.on("install", function () { svc.on("install", function () {
svc.start(); svc.start();
logger.info("bridgeLayer installed and started"); logger.info("ioServer installed and started");
}); });
svc.install(); svc.install();
@ -112,11 +112,11 @@ switch (parser.parseArgs().mode) {
break; break;
case "restart": case "restart":
svc.on("start", function () { svc.on("start", function () {
logger.info("bridgeLayer started"); logger.info("ioServer started");
}); });
svc.on("stop", function () { svc.on("stop", function () {
logger.info( logger.info(
"bridgeLayer stopped / not running. Manually Starting Service again" "ioServer stopped / not running. Manually Starting Service again"
); );
try { try {
svc.start(); svc.start();
@ -125,13 +125,20 @@ switch (parser.parseArgs().mode) {
} }
}); });
svc.on("error", function (error) { svc.on("error", function (error) {
logger.error("bridgeLayer stopped"); logger.error("ioServer stopped");
}); });
// Manually stop the Service // Manually stop the Service
svc.stop(); svc.stop();
break; break;
case "start":
svc.on("start", function () {
logger.info("ioServer started");
});
svc.start();
break;
default: default:
logger.error("Invalid mode have been provided"); logger.error("Invalid mode have been provided");
} }

View File

@ -131,7 +131,12 @@ switch (parser.parseArgs().mode) {
// Manually stop the Service // Manually stop the Service
svc.stop(); svc.stop();
break; break;
case "start":
svc.on("start", function () {
logger.info("{{name}} started");
});
svc.start();
break;
default: default:
logger.error("Invalid mode have been provided"); logger.error("Invalid mode have been provided");
} }