refactoring build script

This commit is contained in:
Alexey Bannov 2021-11-16 16:14:21 +03:00
parent f0cfeb1b42
commit 62403e127a
4 changed files with 11 additions and 44 deletions

View File

@ -3,21 +3,12 @@
PUSHD %~dp0..
call runasadmin.bat "%~dpnx0"
if %errorlevel% == 0 (
for /R "run\" %%f in (*.bat) do (
call sc stop "Onlyoffice%%~nf" > nul
call sc start "Onlyoffice%%~nf" > nul
if %errorlevel% == 0 (
echo Onlyoffice%%~nf service has been restarted
) else (
echo Couldn't restarte Onlyoffice%%~nf service
)
)
)
POPD
if %errorlevel% == 0 (
pwsh %~dp0/command.ps1 "restart"
)
echo.
if "%1"=="nopause" goto start

View File

@ -4,7 +4,10 @@ PUSHD %~dp0..
call runasadmin.bat "%~dpnx0"
POPD
powershell %~dp0/start.ps1
if %errorlevel% == 0 (
pwsh %~dp0/command.ps1 "start"
)
echo.

View File

@ -1,19 +0,0 @@
$WorkDir = "$(Split-Path -Parent $PSScriptRoot)\run"
workflow StartServices-Runbook
{
param(
[string]$WorkDir
)
foreach -parallel($s in Get-ChildItem -Path $WorkDir | ForEach-Object -Process {[System.IO.Path]::GetFileNameWithoutExtension($_)}) {
Start-Service -InputObject $(Get-Service -Name "Onlyoffice$s")
Write-Output "Onlyoffice$s service has been started"
}
}
#Write-Output "Starting services at time: $(Get-Date -Format HH:mm:ss)"
#Write-Output ""
StartServices-Runbook $WorkDir
#Write-Output ""
#Write-Output "End start services at time: $(Get-Date -Format HH:mm:ss)"

View File

@ -3,22 +3,14 @@
PUSHD %~dp0..
call runasadmin.bat "%~dpnx0"
if %errorlevel% == 0 (
for /R "run\" %%f in (*.bat) do (
call sc stop "Onlyoffice%%~nf" > nul
POPD
if %errorlevel% == 0 (
echo Onlyoffice%%~nf service has been stopped
) else (
echo Couldn't stop Onlyoffice%%~nf service
)
)
if %errorlevel% == 0 (
pwsh %~dp0/command.ps1 "stop"
)
echo.
POPD
if "%1"=="nopause" goto start
pause
:start