2021-10-26 13:39:00 +00:00
|
|
|
@echo off
|
|
|
|
|
2021-12-24 13:47:37 +00:00
|
|
|
cd /D "%~dp0"
|
2021-08-16 12:18:45 +00:00
|
|
|
call runasadmin.bat "%~dpnx0"
|
2021-10-26 13:39:00 +00:00
|
|
|
|
2021-08-16 12:18:45 +00:00
|
|
|
if %errorlevel% == 0 (
|
2021-08-12 13:19:16 +00:00
|
|
|
PUSHD %~dp0..
|
|
|
|
|
2021-10-27 10:49:19 +00:00
|
|
|
IF "%2"=="personal" (
|
|
|
|
echo "mode=%2"
|
|
|
|
) ELSE (
|
|
|
|
echo "mode="
|
|
|
|
)
|
2021-09-14 07:05:53 +00:00
|
|
|
|
2021-08-12 13:24:09 +00:00
|
|
|
REM call yarn wipe
|
|
|
|
call yarn install
|
|
|
|
|
2021-08-12 13:19:16 +00:00
|
|
|
REM call yarn build
|
2021-10-27 10:49:19 +00:00
|
|
|
IF "%2"=="personal" (
|
2021-09-14 07:05:53 +00:00
|
|
|
call yarn build:personal
|
2021-10-27 10:49:19 +00:00
|
|
|
) ELSE (
|
|
|
|
call yarn build
|
2021-09-14 07:05:53 +00:00
|
|
|
)
|
2021-08-12 13:19:16 +00:00
|
|
|
|
|
|
|
REM call yarn wipe
|
2021-10-27 10:49:19 +00:00
|
|
|
IF "%2"=="personal" (
|
2021-09-14 07:05:53 +00:00
|
|
|
call yarn deploy:personal
|
2021-10-27 10:49:19 +00:00
|
|
|
) ELSE (
|
|
|
|
call yarn deploy
|
2021-09-14 07:05:53 +00:00
|
|
|
)
|
2021-08-12 13:19:16 +00:00
|
|
|
|
2021-08-17 08:00:36 +00:00
|
|
|
REM copy nginx configurations to deploy folder
|
2021-08-16 16:26:16 +00:00
|
|
|
xcopy config\nginx\onlyoffice.conf build\deploy\nginx\ /E /R /Y
|
|
|
|
powershell -Command "(gc build\deploy\nginx\onlyoffice.conf) -replace '#', '' | Out-File -encoding ASCII build\deploy\nginx\onlyoffice.conf"
|
|
|
|
|
2021-08-16 12:18:45 +00:00
|
|
|
xcopy config\nginx\sites-enabled\* build\deploy\nginx\sites-enabled\ /E /R /Y
|
2021-08-16 16:26:16 +00:00
|
|
|
|
2021-08-17 08:00:36 +00:00
|
|
|
REM fix paths
|
2021-08-16 12:18:45 +00:00
|
|
|
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-files.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Files\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-files.conf"
|
|
|
|
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-login.conf) -replace 'ROOTPATH', '%~dp0deploy\studio\login' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-login.conf"
|
|
|
|
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-people.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.People\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-people.conf"
|
|
|
|
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-studio.conf) -replace 'ROOTPATH', '%~dp0deploy\studio\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-studio.conf"
|
|
|
|
|
2021-08-17 08:00:36 +00:00
|
|
|
REM restart nginx
|
2021-10-26 13:39:00 +00:00
|
|
|
echo service nginx stop
|
2021-11-15 16:36:09 +00:00
|
|
|
call sc stop nginx > nul
|
2021-08-17 08:00:36 +00:00
|
|
|
|
|
|
|
REM sleep 5 seconds
|
|
|
|
call ping 127.0.0.1 -n 6 > nul
|
|
|
|
|
2021-10-26 13:39:00 +00:00
|
|
|
echo service nginx start
|
2021-11-15 16:36:09 +00:00
|
|
|
call sc start nginx > nul
|
|
|
|
|
|
|
|
if NOT %errorlevel% == 0 (
|
2022-02-22 15:23:56 +00:00
|
|
|
echo Couldn't restart Onlyoffice%%~nf service
|
2021-11-15 16:36:09 +00:00
|
|
|
)
|
|
|
|
|
2021-10-26 13:39:00 +00:00
|
|
|
)
|
|
|
|
|
2021-11-15 16:36:09 +00:00
|
|
|
echo.
|
|
|
|
|
|
|
|
POPD
|
|
|
|
|
2021-10-26 13:39:00 +00:00
|
|
|
if "%1"=="nopause" goto start
|
|
|
|
pause
|
|
|
|
:start
|