forked from tableau/TabPy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.cmd
executable file
·69 lines (53 loc) · 1.38 KB
/
startup.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@ECHO off
SETLOCAL
REM Set environment variables.
SET TABPY_ROOT=%CD%
SET INSTALL_LOG=%TABPY_ROOT%\tabpy-server\install.log
REM Install requirements using Python setup tools.
ECHO Installing any missing dependencies...
CD %TABPY_ROOT%\tabpy-server
ECHO Installing tabpy-server dependencies...>%INSTALL_LOG%
python setup.py install>>%INSTALL_LOG% 2>&1
CD %TABPY_ROOT%\tabpy-tools
ECHO: >> %INSTALL_LOG%
ECHO Installing tabpy-tools dependencies...>>%INSTALL_LOG%
python setup.py install>>%INSTALL_LOG% 2>&1
CD %TABPY_ROOT%
SET INSTALL_LOG_MESSAGE= Check %INSTALL_LOG% for details.
IF %ERRORLEVEL% NEQ 0 (
IF %CD% NEQ %TABPY_ROOT% (
CD %TABPY_ROOT%
)
ECHO failed
ECHO %INSTALL_LOG_MESSAGE%
GOTO:ERROR
) ELSE (
ECHO success
ECHO %INSTALL_LOG_MESSAGE%
)
REM Parse optional CLI arguments: port and config.
ECHO Parsing parameters...
SET STARTUP_CMD=python tabpy.py
IF [%1] NEQ [] (
ECHO Using config file at %TABPY_ROOT%\tabpy-server\tabpy_server\%1
SET STARTUP_CMD=%STARTUP_CMD% --config=%1
)
REM Start TabPy server.
ECHO Starting TabPy server...
ECHO;
CD %TABPY_ROOT%\tabpy-server\tabpy_server
%STARTUP_CMD%
CD %TABPY_ROOT%
IF %ERRORLEVEL% NEQ 0 (
ECHO Failed to start TabPy server.
GOTO:ERROR
)
GOTO:SUCCESS
REM Exit with error
:ERROR
ENDLOCAL
EXIT /B 1
REM All succeeded
:SUCCESS
EXIT /B %ERRORLEVEL%
ENDLOCAL