DocSpace-buildtools/build/build.static.bat

71 lines
3.2 KiB
Batchfile
Raw Normal View History

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="
)
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
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-calendar.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Calendar\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-calendar.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-crm.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.CRM\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-crm.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-editor.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Files\editor' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-editor.conf"
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-mail.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Mail\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-mail.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-projects.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Projects\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-projects.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 (
echo Couldn't restarte Onlyoffice%%~nf service
)
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