|
1 | 1 | @echo off |
2 | | - |
3 | 2 | SET DIR=%~dp0% |
| 3 | +cd / |
| 4 | +mkdir doccano |
| 5 | +cd c:/doccano |
| 6 | +mkdir logs |
4 | 7 | cd %DIR% |
| 8 | +set hr=%time:~0,2% |
| 9 | +set hr=%hr: =0% |
| 10 | +set LOGFILE=C:\doccano\logs\install_log_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%.txt |
| 11 | + |
| 12 | +call :LOG1 2> %LOGFILE% |
| 13 | + |
| 14 | +python "%DIR%doccano\app\manage.py" migrate |
| 15 | +python "%DIR%doccano\app\manage.py" createsuperuser |
| 16 | + |
| 17 | +call :LOG2 2>> %LOGFILE% |
| 18 | + |
| 19 | +exit /B |
| 20 | + |
| 21 | +:LOG2 |
| 22 | + |
| 23 | +call "C:/doccano/venv/scripts/deactivate" |
| 24 | +cd "%DIR%doccano\app\server\static" |
| 25 | +call npm install |
| 26 | +cd "%DIR%" |
| 27 | +copy "%DIR%annotation.html" "%DIR%doccano\app\server\templates" /Y |
| 28 | +net stop doccano /Y |
| 29 | +nssm remove doccano confirm |
| 30 | +nssm install doccano %DIR%run_doccano.bat %DIR% |
| 31 | +nssm start doccano |
| 32 | +net stop start_webpack /Y |
| 33 | +nssm remove start_webpack confirm |
| 34 | +nssm install start_webpack %DIR%start_webpack.bat %DIR% |
| 35 | +nssm start start_webpack |
| 36 | +pause |
| 37 | +exit /B |
| 38 | + |
| 39 | +:LOG1 |
| 40 | + |
5 | 41 | ::install chocolatey |
| 42 | +echo installing chocolatey |
6 | 43 | %systemroot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%DIR%install_chocolatey.ps1' %*" -Verb RunAs |
7 | 44 | call refresh_path.bat |
| 45 | +echo installing git,node and python |
8 | 46 | ::install git,node and python |
9 | 47 | %systemroot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%DIR%install_deps.ps1' %*" -Verb RunAs |
10 | 48 | SET PATH=%PATH%;C:\Program Files\Git\bin;C:\Program Files\nodejs |
11 | 49 | call refresh_path.bat |
12 | 50 | pip install virtualenv |
13 | | -virtualenv venv |
14 | | -call venv/scripts/activate |
| 51 | +virtualenv "C:/doccano/venv" |
| 52 | +call C:/doccano/venv/scripts/activate |
| 53 | +python -m pip install --force-reinstall pip |
15 | 54 | call git clone https://github.com/doccano/doccano.git doccano |
16 | 55 | cd "%DIR%doccano" |
17 | 56 | call git checkout bdba2961bf7942eb529a1591a7499b5d15af73bf |
18 | 57 | git config --global url."https://".insteadOf git:// |
19 | 58 | pip install -r "%DIR%doccano\requirements.txt" |
20 | 59 | cd "%DIR%doccano\frontend" |
21 | 60 | SET PATH=%PATH%;%systemroot%\System32\WindowsPowerShell\v1.0\ |
22 | | -call npm install --global windows-build-tools |
| 61 | +call npm install --global windows-build-tools --vs2015 |
23 | 62 | SET NODE_GYP_FORCE_PYTHON=%userprofile%\.windows-build-tools\python27\python.exe |
24 | 63 | call npm install |
25 | 64 | call npm run build |
26 | 65 | cd "%DIR%doccano\app" |
27 | | -python "%DIR%doccano\app\manage.py" migrate |
28 | | -python "%DIR%doccano\app\manage.py" createsuperuser |
29 | | -call deactivate |
30 | | -cd "%DIR%doccano\app\server\static" |
31 | | -call npm install |
32 | | -cd "%DIR%" |
33 | | -copy "%DIR%annotation.html" "%DIR%doccano\app\server\templates" /Y |
34 | | -net stop doccano /Y |
35 | | -nssm remove doccano confirm |
36 | | -nssm install doccano %DIR%run_doccano.bat %DIR% |
37 | | -nssm start doccano |
38 | | -net stop start_webpack /Y |
39 | | -nssm remove start_webpack confirm |
40 | | -nssm install start_webpack %DIR%start_webpack.bat %DIR% |
41 | | -nssm start start_webpack |
|
0 commit comments