From 394aafbe9704ad63397935e32f5224d4cfc6c1ea Mon Sep 17 00:00:00 2001 From: Timofey Boyko Date: Thu, 19 May 2022 15:26:36 +0300 Subject: [PATCH] Add bat file for run e2e translations tests on personal --- build/run.e2e.translations.tests.personal.bat | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 build/run.e2e.translations.tests.personal.bat diff --git a/build/run.e2e.translations.tests.personal.bat b/build/run.e2e.translations.tests.personal.bat new file mode 100644 index 0000000000..cc29d7a2dd --- /dev/null +++ b/build/run.e2e.translations.tests.personal.bat @@ -0,0 +1,71 @@ +@echo off + +PUSHD %~dp0 +call runasadmin.bat "%~dpnx0" + +if %errorlevel% == 0 ( +PUSHD %~dp0.. + + +echo "mode=" + + +REM call yarn wipe +call yarn install + +call yarn build:test.translation:personal + +REM call yarn wipe +call yarn deploy:personal + + + +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" +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" + +REM restart nginx +echo service nginx stop +call sc stop nginx > nul + +REM sleep 5 seconds +call ping 127.0.0.1 -n 6 > nul + +echo service nginx start +call sc start nginx > nul + +REM sleep 5 seconds +call ping 127.0.0.1 -n 6 > nul + +call yarn e2e.test:translation:personal + +exit + + + +if NOT %errorlevel% == 0 ( + echo Couldn't restarte Onlyoffice%%~nf service +) + +) + +echo. + +POPD + +if "%1"=="nopause" goto start +pause +:start \ No newline at end of file