DocSpace-buildtools/build.static.bat

69 lines
1.3 KiB
Batchfile
Raw Normal View History

2021-10-26 13:39:00 +00:00
@echo off
2023-10-03 10:25:25 +00:00
for %%i in ("%~dp0..") do set "parentFolder=%%~fi"
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="
)
2023-10-02 14:10:08 +00:00
cd client
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" (
call yarn build:personal
2021-10-27 10:49:19 +00:00
) ELSE (
call yarn build
)
2021-08-12 13:19:16 +00:00
REM call yarn wipe
2021-10-27 10:49:19 +00:00
IF "%2"=="personal" (
call yarn deploy:personal
2021-10-27 10:49:19 +00:00
) ELSE (
call yarn deploy
)
2021-08-12 13:19:16 +00:00
2023-10-02 14:10:08 +00:00
cd ..
2021-08-17 08:00:36 +00:00
REM copy nginx configurations to deploy folder
2023-10-02 14:10:08 +00:00
xcopy buildtools\config\nginx\onlyoffice.conf publish\nginx\ /E /R /Y
powershell -Command "(gc publish\nginx\onlyoffice.conf) -replace '#', '' | Out-File -encoding ASCII publish\nginx\onlyoffice.conf"
2021-08-16 16:26:16 +00:00
2023-10-02 14:10:08 +00:00
xcopy buildtools\config\nginx\sites-enabled\* publish\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
2023-10-03 10:25:25 +00:00
powershell -Command "(gc publish\nginx\sites-enabled\onlyoffice-client.conf) -replace 'ROOTPATH', '%parentFolder%\publish\web\client' -replace '\\', '/' | Out-File -encoding ASCII publish\nginx\sites-enabled\onlyoffice-client.conf"
2021-08-16 12:18:45 +00:00
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 (
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