From 5c492ee5830204607412fad6ff8249ea56d22192 Mon Sep 17 00:00:00 2001 From: AlexeySafronov Date: Tue, 17 Aug 2021 11:00:36 +0300 Subject: [PATCH] Build: Optimization of build process --- build/build.static.bat | 7 +++++++ build/buildAndDeploy.bat | 18 ++++++++++++++++++ build/run/CalendarClient.bat | 2 -- build/run/CrmClient.bat | 2 -- build/run/FileClient.bat | 2 -- build/run/MailClient.bat | 2 -- build/run/PeopleClient.bat | 2 -- build/run/ProjectsClient.bat | 2 -- build/run/WebClient.bat | 2 -- build/run/WebEditorClient.bat | 2 -- build/run/WebLoginClient.bat | 2 -- build/start/start.backend.bat | 8 -------- build/start/stop.backend.bat | 8 -------- 13 files changed, 25 insertions(+), 34 deletions(-) create mode 100644 build/buildAndDeploy.bat delete mode 100644 build/run/CalendarClient.bat delete mode 100644 build/run/CrmClient.bat delete mode 100644 build/run/FileClient.bat delete mode 100644 build/run/MailClient.bat delete mode 100644 build/run/PeopleClient.bat delete mode 100644 build/run/ProjectsClient.bat delete mode 100644 build/run/WebClient.bat delete mode 100644 build/run/WebEditorClient.bat delete mode 100644 build/run/WebLoginClient.bat delete mode 100644 build/start/start.backend.bat delete mode 100644 build/start/stop.backend.bat diff --git a/build/build.static.bat b/build/build.static.bat index 3339278546..ac90f4db12 100644 --- a/build/build.static.bat +++ b/build/build.static.bat @@ -12,11 +12,13 @@ call yarn build REM call yarn wipe call yarn deploy +REM copy nginx configurations to deploy folder 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" xcopy config\nginx\sites-enabled\* build\deploy\nginx\sites-enabled\ /E /R /Y +REM fix paths 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" @@ -27,7 +29,12 @@ powershell -Command "(gc 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" +REM restart nginx call sc stop nginx + +REM sleep 5 seconds +call ping 127.0.0.1 -n 6 > nul + call sc start nginx pause diff --git a/build/buildAndDeploy.bat b/build/buildAndDeploy.bat new file mode 100644 index 0000000000..01806953b4 --- /dev/null +++ b/build/buildAndDeploy.bat @@ -0,0 +1,18 @@ +PUSHD %~dp0 +call runasadmin.bat "%~dpnx0" +if %errorlevel% == 0 ( + +call start\stop.bat + +PUSHD %~dp0.. + +echo "FRONT-END static" +call build\build.static.bat + +echo "BACK-END" +call build\build.backend.bat + +start /b call build\start\start.bat + +pause +) \ No newline at end of file diff --git a/build/run/CalendarClient.bat b/build/run/CalendarClient.bat deleted file mode 100644 index 297b74d734..0000000000 --- a/build/run/CalendarClient.bat +++ /dev/null @@ -1,2 +0,0 @@ -echo "RUN ASC.Web.Calendar" -call set BROWSER=none&&npm start --prefix ../../products/ASC.Calendar/Client \ No newline at end of file diff --git a/build/run/CrmClient.bat b/build/run/CrmClient.bat deleted file mode 100644 index 7d017867ac..0000000000 --- a/build/run/CrmClient.bat +++ /dev/null @@ -1,2 +0,0 @@ -echo "RUN ASC.Web.CRM" -call set BROWSER=none&&npm start --prefix ../../products/ASC.CRM/Client \ No newline at end of file diff --git a/build/run/FileClient.bat b/build/run/FileClient.bat deleted file mode 100644 index 19e57b7b20..0000000000 --- a/build/run/FileClient.bat +++ /dev/null @@ -1,2 +0,0 @@ -echo "RUN ASC.Web.Files" -call set BROWSER=none&&npm start --prefix ../../products/ASC.Files/Client \ No newline at end of file diff --git a/build/run/MailClient.bat b/build/run/MailClient.bat deleted file mode 100644 index ea4da86a48..0000000000 --- a/build/run/MailClient.bat +++ /dev/null @@ -1,2 +0,0 @@ -echo "RUN ASC.Web.Mail" -call set BROWSER=none&&npm start --prefix ../../products/ASC.Mail/Client \ No newline at end of file diff --git a/build/run/PeopleClient.bat b/build/run/PeopleClient.bat deleted file mode 100644 index d6abfc0f78..0000000000 --- a/build/run/PeopleClient.bat +++ /dev/null @@ -1,2 +0,0 @@ -echo "RUN ASC.Web.Studio" -call set BROWSER=none&&npm start --prefix ../../products/ASC.People/Client \ No newline at end of file diff --git a/build/run/ProjectsClient.bat b/build/run/ProjectsClient.bat deleted file mode 100644 index 588e78d00c..0000000000 --- a/build/run/ProjectsClient.bat +++ /dev/null @@ -1,2 +0,0 @@ -echo "RUN ASC.Web.Projects" -call set BROWSER=none&&npm start --prefix ../../products/ASC.Projects/Client \ No newline at end of file diff --git a/build/run/WebClient.bat b/build/run/WebClient.bat deleted file mode 100644 index 43d6464c7f..0000000000 --- a/build/run/WebClient.bat +++ /dev/null @@ -1,2 +0,0 @@ -echo "RUN ASC.Web.Studio" -call set BROWSER=none&&npm start --prefix ../../web/ASC.Web.Client/ \ No newline at end of file diff --git a/build/run/WebEditorClient.bat b/build/run/WebEditorClient.bat deleted file mode 100644 index e56c9fb77e..0000000000 --- a/build/run/WebEditorClient.bat +++ /dev/null @@ -1,2 +0,0 @@ -echo "RUN ASC.Web.Editor" -call set BROWSER=none&&npm start --prefix ../../web/ASC.Web.Editor/ \ No newline at end of file diff --git a/build/run/WebLoginClient.bat b/build/run/WebLoginClient.bat deleted file mode 100644 index ceac67d274..0000000000 --- a/build/run/WebLoginClient.bat +++ /dev/null @@ -1,2 +0,0 @@ -echo "RUN ASC.Web.Login" -call set BROWSER=none&&npm start --prefix ../../web/ASC.Web.Login/ \ No newline at end of file diff --git a/build/start/start.backend.bat b/build/start/start.backend.bat deleted file mode 100644 index 6c0ecaead3..0000000000 --- a/build/start/start.backend.bat +++ /dev/null @@ -1,8 +0,0 @@ -PUSHD %~dp0.. -call runasadmin.bat "%~dpnx0" - -if %errorlevel% == 0 ( - for /f %%f in ('dir /b run ^| findstr /v /i "\Client.bat$"') do ( - call nssm start Onlyoffice%%~nf - ) -) \ No newline at end of file diff --git a/build/start/stop.backend.bat b/build/start/stop.backend.bat deleted file mode 100644 index f637efb9b3..0000000000 --- a/build/start/stop.backend.bat +++ /dev/null @@ -1,8 +0,0 @@ -PUSHD %~dp0.. -call runasadmin.bat "%~dpnx0" - -if %errorlevel% == 0 ( - for /f %%f in ('dir /b run ^| findstr /v /i "\Client.bat$"') do ( - call nssm stop Onlyoffice%%~nf - ) -) \ No newline at end of file