Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28555b387f | ||
|
|
9ad8756ec2 | ||
|
|
98815af8b6 | ||
|
|
0aeb20ee64 | ||
|
|
efeb9d6d20 | ||
|
|
9d96d6123e | ||
|
|
36ffdb93e8 | ||
|
|
ecbba79c2a | ||
|
|
13f52ad9ac | ||
|
|
849e34c2f7 | ||
|
|
fb747b8031 | ||
|
|
c6d295727c | ||
|
|
74cfeabd02 | ||
|
|
d8f9e3e87b | ||
|
|
f552519ed6 | ||
|
|
bbeb395beb | ||
|
|
acb61f0990 | ||
|
|
e6e7cf0f69 | ||
|
|
6b3a628e7a | ||
|
|
9c5b9364b6 | ||
|
|
1770c94b07 | ||
|
|
0694f59e70 | ||
|
|
98bfbcff8f | ||
|
|
42aa4dcd22 | ||
|
|
59446bb4b5 | ||
|
|
a5d39003b6 | ||
|
|
c45675e019 | ||
|
|
27d3990ba2 | ||
|
|
d326ddd21a | ||
|
|
3ad606733a | ||
|
|
38b034ec3c | ||
|
|
0766b17726 | ||
|
|
73b144c45c | ||
|
|
98283c1213 | ||
|
|
5be0d17df5 | ||
|
|
bacb57086c | ||
|
|
e5598038fa | ||
|
|
a39f43788b | ||
|
|
aae49b5324 | ||
|
|
34045efb38 | ||
|
|
292ac32db5 | ||
|
|
ccb0796317 | ||
|
|
841af6868d | ||
|
|
e2482d2294 | ||
|
|
554455fa75 | ||
|
|
255afe673a | ||
|
|
c64373435b | ||
|
|
622b67684d | ||
|
|
e5e154e268 | ||
|
|
122336eb63 | ||
|
|
17694ab467 | ||
|
|
438116c574 | ||
|
|
944cc55df7 | ||
|
|
6af8efb5b1 | ||
|
|
1f43b05c2a | ||
|
|
10ee75bb1f | ||
|
|
0aa93ac3ba | ||
|
|
f72dcc23ea | ||
|
|
1fc66406f5 | ||
|
|
e0e7d6f1f6 | ||
|
|
7f3e5c95c6 | ||
|
|
399d490342 | ||
|
|
c411520d98 | ||
|
|
3d202dceeb | ||
|
|
23f36c5a41 | ||
|
|
6db4cfd9f1 | ||
|
|
9c3da10eea | ||
|
|
a4cd2fe6c6 | ||
|
|
eb3d3980e0 | ||
|
|
28ce485cd2 | ||
|
|
a1ce6d9513 | ||
|
|
8efdc43177 | ||
|
|
8c65608946 | ||
|
|
22d458b01e | ||
|
|
0cc37de404 | ||
|
|
8f4d1f14f2 | ||
|
|
c888b282ea | ||
|
|
4a75053514 | ||
|
|
3fae181c27 | ||
|
|
c6ba8899d1 | ||
|
|
9a758f8fd3 | ||
|
|
bb25d1a986 | ||
|
|
d2ee5c4e82 | ||
|
|
605b1f4799 | ||
|
|
5fdc1ffb38 | ||
|
|
9c21c07fc4 | ||
|
|
da83c3d1b8 | ||
|
|
9df89f9bd5 | ||
|
|
aad7830d37 | ||
|
|
dae8186c2a | ||
|
|
93234c86b7 | ||
|
|
b786c4c140 | ||
|
|
cbfa614cf9 | ||
|
|
da3b3de397 | ||
|
|
cbd8f8236a | ||
|
|
38feacd04d | ||
|
|
6244463ac1 | ||
|
|
2afa3d8267 | ||
|
|
3b35aaa1d7 | ||
|
|
1bce0b5eef | ||
|
|
0bb4f005e5 | ||
|
|
317a04eafc | ||
|
|
0e489df7b0 | ||
|
|
ab094e8f16 | ||
|
|
430be1c4cb | ||
|
|
0e8f804279 | ||
|
|
1858596253 | ||
|
|
fedbcd4045 | ||
|
|
821496dc84 | ||
|
|
07f16f40cd | ||
|
|
2d7eaa63c4 | ||
|
|
d9fc9fdc4d | ||
|
|
42c7ae372f | ||
|
|
d4fe31404c | ||
|
|
f316e0533e | ||
|
|
08cf2c8310 | ||
|
|
406ada10f5 | ||
|
|
1f29859040 | ||
|
|
fcfe0929d3 | ||
|
|
e27c2c421e | ||
|
|
d92368f8e5 | ||
|
|
11ab1918ea | ||
|
|
c6bae69b6f | ||
|
|
ea87d6da8f | ||
|
|
f731ab730b | ||
|
|
3e7381414f | ||
|
|
cd311ca8a9 | ||
|
|
a0d2c45361 | ||
|
|
407f885559 | ||
|
|
6fc2e032f3 | ||
|
|
3ffeb4be45 | ||
|
|
a9794d8ab4 | ||
|
|
aedb3997b0 | ||
|
|
c7cbe0ff4a | ||
|
|
27cdb835cb | ||
|
|
06ae799d02 | ||
|
|
69f6895224 | ||
|
|
a163edec7a | ||
|
|
48660508ce | ||
|
|
f779378e8a | ||
|
|
c1aba3e055 | ||
|
|
6bbcaf6b27 | ||
|
|
dec43d98dc | ||
|
|
d7b0508305 | ||
|
|
7ac4e2a9d9 | ||
|
|
2a359d9d77 | ||
|
|
7b0c81126c | ||
|
|
6735c30292 | ||
|
|
1f082a0488 | ||
|
|
8b135f2932 | ||
|
|
d4a2f1b8cd | ||
|
|
14f462e9dc | ||
|
|
d641b47adb | ||
|
|
252e05ef29 | ||
|
|
8fb340d23b | ||
|
|
a8167f0a72 | ||
|
|
f7fa18f827 | ||
|
|
01b87d4834 | ||
|
|
868622912e | ||
|
|
6d0c4bc116 | ||
|
|
3c7742f3b2 | ||
|
|
11870006c3 | ||
|
|
ea514115c3 | ||
|
|
561ee7556f | ||
|
|
e2857332b7 | ||
|
|
d361e604c1 | ||
|
|
419bb7f995 | ||
|
|
365cbc34f5 | ||
|
|
e9ba2e036a | ||
|
|
c5d49bd862 | ||
|
|
23b649fbd1 | ||
|
|
ce1c06d7f1 | ||
|
|
fb02f8b1be | ||
|
|
4e27bf989f | ||
|
|
b5c7a108ab | ||
|
|
d6778aa915 | ||
|
|
7d2ab6a685 | ||
|
|
7f40444087 | ||
|
|
ad56e7fb12 | ||
|
|
598f69b63d | ||
|
|
7d765fea04 | ||
|
|
1283c22bb9 | ||
|
|
2817ec438a | ||
|
|
c455dda3ce | ||
|
|
3a130d68c5 | ||
|
|
6a9406237a | ||
|
|
d7da8be486 | ||
|
|
6e5b54eb1a | ||
|
|
e23d307c56 | ||
|
|
86ecf9c84e | ||
|
|
1b9c841c15 | ||
|
|
41c028f944 | ||
|
|
5799ac14ba | ||
|
|
a000dc6f60 | ||
|
|
12b7e03085 | ||
|
|
943fc25f60 | ||
|
|
f62d35bf3c | ||
|
|
e2df00fc05 | ||
|
|
36db047071 | ||
|
|
ffae65bdbe | ||
|
|
d14fb85fff | ||
|
|
13dbfff11d | ||
|
|
ed01dbd0ef | ||
|
|
cb880678cc | ||
|
|
7515e08578 | ||
|
|
c973c3387e | ||
|
|
72ba5bdaee | ||
|
|
62bb3ca097 | ||
|
|
e666b0fab0 | ||
|
|
dfbb2212c0 | ||
|
|
52fb8e197f | ||
|
|
d68eede3e6 | ||
|
|
04735e631e | ||
|
|
90b2d2e536 | ||
|
|
3448465e82 | ||
|
|
72a2db53c3 | ||
|
|
5cfe0ef115 | ||
|
|
312bcbc83f | ||
|
|
566ff7b609 | ||
|
|
45cd17af84 | ||
|
|
12ef55334b | ||
|
|
f2773354c8 | ||
|
|
431516ad61 | ||
|
|
1141930178 | ||
|
|
55402ec7d9 | ||
|
|
980d1e0292 | ||
|
|
739864c7d1 | ||
|
|
7e3bd8b88a | ||
|
|
6428ffcdaf | ||
|
|
660293456c | ||
|
|
0100997aab | ||
|
|
c80b91876a | ||
|
|
f4f0fa0e47 | ||
|
|
851c0cfff3 | ||
|
|
9a3047c89c | ||
|
|
d801ed5008 | ||
|
|
bdf9f3404f | ||
|
|
c79ac2f8d2 | ||
|
|
63f7fbcf7d | ||
|
|
d61fc8b8db | ||
|
|
527e084ef7 | ||
|
|
b6842e88ac | ||
|
|
f0327f5219 | ||
|
|
3cfc3366d7 | ||
|
|
05e067035f | ||
|
|
8b5abdfa8f | ||
|
|
782b7419f6 | ||
|
|
bbb8433af3 | ||
|
|
ef68cae1f1 | ||
|
|
9b0889842d | ||
|
|
eae18f6f14 | ||
|
|
29ed7ec881 | ||
|
|
220fdf583e | ||
|
|
628f0d254e | ||
|
|
7dde5d52d0 | ||
|
|
95cda78bdb | ||
|
|
e59eaedfd0 | ||
|
|
f17979141c | ||
|
|
3359a0de7a | ||
|
|
6e03775f05 | ||
|
|
b58f288eec | ||
|
|
140372a5cf | ||
|
|
d97431cb4f | ||
|
|
1e14b0d068 | ||
|
|
4ff0fcdd82 | ||
|
|
696fbfb8b9 | ||
|
|
be47390baf | ||
|
|
0d5a6eeeff | ||
|
|
6ddab02769 | ||
|
|
091aa62084 | ||
|
|
2058cdf662 | ||
|
|
6bc6bc7f60 | ||
|
|
370df47042 | ||
|
|
9ae49cbf31 | ||
|
|
822d384746 | ||
|
|
ce31726af5 | ||
|
|
494a8ac3fe | ||
|
|
50738db2b8 | ||
|
|
6fa6939f52 | ||
|
|
ef0e53e8fc | ||
|
|
fd2c2c4ff7 | ||
|
|
d6c4911135 | ||
|
|
6991c06937 | ||
|
|
3f16a0c52c | ||
|
|
4a6426d3e7 | ||
|
|
235a75202d | ||
|
|
55cf0cf2f9 | ||
|
|
0565f8dd78 | ||
|
|
bdf90e67a7 | ||
|
|
7144db7f5a | ||
|
|
c66840bc8e | ||
|
|
26ad6d4c5d | ||
|
|
87b64cf3c0 | ||
|
|
0f1651686b | ||
|
|
528ea88dec | ||
|
|
44ef501283 | ||
|
|
eb27fa29b1 | ||
|
|
a89ab88097 | ||
|
|
c092495b7a | ||
|
|
8e2ede21a0 | ||
|
|
15fe26a710 | ||
|
|
530017809a | ||
|
|
6c2c18106f | ||
|
|
1b20831338 | ||
|
|
6a46e43567 | ||
|
|
003889f15e | ||
|
|
a2258c83e9 | ||
|
|
370d9c72ec | ||
|
|
026969e3d1 | ||
|
|
0ec3224212 | ||
|
|
38ddea038a | ||
|
|
d6c64e8f11 | ||
|
|
4010dc80a9 | ||
|
|
9c5e42c7a6 | ||
|
|
532cbe216a | ||
|
|
1850a3a995 | ||
|
|
22776d2e14 | ||
|
|
7f1b588c69 | ||
|
|
8f88443e15 | ||
|
|
a74b9c96c1 | ||
|
|
0e59be237b | ||
|
|
6a4689599d | ||
|
|
6e54a13ba2 | ||
|
|
fa1cf7b7a3 | ||
|
|
82c9cca683 |
No files matched your search
@@ -1,399 +1,383 @@
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
|
||||
SET WD=%CD%
|
||||
SET "PGBUILDPATH=%WD%\win-build"
|
||||
|
||||
SET CMDOPTION=""
|
||||
IF "%1" == "clean" SET CMDOPTION="VALID"
|
||||
IF "%1" == "x86" SET CMDOPTION="VALID"
|
||||
|
||||
IF NOT %CMDOPTION%=="VALID" (
|
||||
GOTO USAGE
|
||||
)
|
||||
|
||||
SET ARCHITECTURE=%1
|
||||
|
||||
IF "%ARCHITECTURE%"=="clean" (
|
||||
CALL :CLEAN
|
||||
EXIT /B %ERRORLEVEL%
|
||||
)
|
||||
|
||||
|
||||
REM Main build sequence
|
||||
CALL :SET_ENVIRONMENT
|
||||
CALL :VALIDATE_ENVIRONMENT || EXIT /B 1
|
||||
CALL :CLEAN || EXIT /B 1
|
||||
CALL :CREATE_VIRTUAL_ENV || EXIT /B 1
|
||||
CALL :CREATE_RUNTIME_ENV || EXIT /B 1
|
||||
CALL :CREATE_PYTHON_ENV || EXIT /B 1
|
||||
CALL :CLEANUP_ENV || EXIT /B 1
|
||||
CALL :CREATE_INSTALLER || EXIT /B 1
|
||||
CALL :SIGN_INSTALLER || EXIT /B 1
|
||||
|
||||
EXIT /B %ERRORLEVEL%
|
||||
REM Main build sequence Ends
|
||||
|
||||
|
||||
:CLEAN
|
||||
ECHO Removing build directory...
|
||||
IF EXIST "%PGBUILDPATH%" RD "%PGBUILDPATH%" /S /Q > nul || EXIT /B 1
|
||||
|
||||
ECHO Removing temp build directory...
|
||||
IF EXIST "%WD%\pkg\win32\Output" rd "%WD%\pkg\win32\Output" /S /Q > nul || EXIT /B 1
|
||||
|
||||
ECHO Removing installer configuration script...
|
||||
IF EXIST DEL /q "%WD%\pkg\win32\installer.iss" > nul || EXIT /B 1
|
||||
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:SET_ENVIRONMENT
|
||||
ECHO Configuring the environment...
|
||||
IF "%PYTHON_HOME%" == "" SET "PYTHON_HOME=C:\Python27"
|
||||
IF "%PYTHON_DLL%" == "" SET "PYTHON_DLL=C:\Windows\SysWOW64\python27.dll"
|
||||
IF "%QTDIR%" == "" SET "QTDIR=C:\Qt\5.9.1\mingw53_32"
|
||||
IF "%MAKE%" == "" SET "MAKE=mingw32-make.exe"
|
||||
IF "%PGDIR%" == "" SET "PGDIR=C:\Program Files (x86)\PostgreSQL\10"
|
||||
IF "%INNOTOOL%" == "" SET "INNOTOOL=C:\Program Files (x86)\Inno Setup 5"
|
||||
IF "%VCREDIST%" == "" SET "VCREDIST=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\1033\vcredist_x86.exe"
|
||||
IF "%SIGNTOOL%" == "" SET "SIGNTOOL=C:\Program Files\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe"
|
||||
|
||||
REM Set VCREDISTNAME (the filename)
|
||||
for /f "delims=" %%i in ("%VCREDIST%") do set "VCREDISTNAME=%%~nxi"
|
||||
|
||||
REM Set additional variables we need
|
||||
SET "QMAKE=%QTDIR%\bin\qmake.exe"
|
||||
FOR /F "tokens=4,5 delims=. " %%a IN ('%QMAKE% -v ^| findstr /B /C:"Using Qt version "') DO SET QT_VERSION=%%a.%%b
|
||||
|
||||
SET "VIRTUALENV=venv"
|
||||
SET "TARGET_DIR=%WD%\dist"
|
||||
|
||||
FOR /F "tokens=3" %%a IN ('findstr /C:"APP_RELEASE =" %WD%\web\config.py') DO SET APP_MAJOR=%%a
|
||||
FOR /F "tokens=3" %%a IN ('findstr /C:"APP_REVISION =" %WD%\web\config.py') DO SET APP_MINOR=%%a
|
||||
FOR /F "tokens=3" %%a IN ('findstr /C:"APP_SUFFIX =" %WD%\web\config.py') DO SET APP_VERSION_SUFFIX=%%a
|
||||
REM remove single quote from the string
|
||||
SET APP_VERSION_SUFFIX=%APP_VERSION_SUFFIX:'=%
|
||||
SET APP_NAME=""
|
||||
FOR /F "tokens=2* DELims='" %%a IN ('findstr /C:"APP_NAME =" web\config.py') DO SET APP_NAME=%%a
|
||||
FOR /f "tokens=1 DELims=." %%G IN ('%PYTHON_HOME%/python.exe -c "print('%APP_NAME%'.lower().replace(' ', ''))"') DO SET APP_SHORTNAME=%%G
|
||||
SET APP_VERSION=%APP_MAJOR%.%APP_MINOR%
|
||||
SET INSTALLERNAME=%APP_SHORTNAME%-%APP_MAJOR%.%APP_MINOR%-%APP_VERSION_SUFFIX%-%ARCHITECTURE%.exe
|
||||
IF "%APP_VERSION_SUFFIX%" == "" SET INSTALLERNAME=%APP_SHORTNAME%-%APP_MAJOR%.%APP_MINOR%-%ARCHITECTURE%.exe
|
||||
|
||||
REM get Python version for the runtime build ex. 2.7.1 will be 27
|
||||
FOR /f "tokens=1 DELims=." %%G IN ('%PYTHON_HOME%/python.exe -c "import sys; print(sys.version.split(' ')[0])"') DO SET PYTHON_MAJOR=%%G
|
||||
FOR /f "tokens=2 DELims=." %%G IN ('%PYTHON_HOME%/python.exe -c "import sys; print(sys.version.split(' ')[0])"') DO SET PYTHON_MINOR=%%G
|
||||
SET "PYTHON_VERSION=%PYTHON_MAJOR%%PYTHON_MINOR%"
|
||||
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:VALIDATE_ENVIRONMENT
|
||||
ECHO ****************************************************************
|
||||
ECHO S U M M A R Y
|
||||
ECHO ****************************************************************
|
||||
ECHO Build path: %PGBUILDPATH%
|
||||
ECHO Output directory: %TARGET_DIR%
|
||||
ECHO Installer name: %INSTALLERNAME%
|
||||
ECHO.
|
||||
ECHO Python home: %PYTHON_HOME%
|
||||
ECHO Python DLL: %PYTHON_DLL%
|
||||
ECHO Python version: %PYTHON_VERSION%
|
||||
ECHO Python major version: %PYTHON_MAJOR%
|
||||
ECHO Python minor version: %PYTHON_MINOR%
|
||||
ECHO.
|
||||
ECHO Qt home: %QTDIR%
|
||||
ECHO qmake executable: %QMAKE%
|
||||
ECHO Qt version: %QT_VERSION%
|
||||
ECHO.
|
||||
ECHO PostgreSQL home: %PGDIR%
|
||||
ECHO.
|
||||
ECHO VC++ redistributable: %VCREDIST%
|
||||
ECHO VC++ redistributable file: %VCREDISTNAME%
|
||||
ECHO.
|
||||
ECHO innotool executable: %INNOTOOL%
|
||||
ECHO signtool executable: %SIGNTOOL%
|
||||
ECHO.
|
||||
ECHO App major version: %APP_MAJOR%
|
||||
ECHO App minor version: %APP_MINOR%
|
||||
ECHO App version: %APP_VERSION%
|
||||
ECHO App version suffix: %APP_VERSION_SUFFIX%
|
||||
ECHO App short name: %APP_SHORTNAME%
|
||||
ECHO App name: %APP_NAME%
|
||||
ECHO ****************************************************************
|
||||
|
||||
ECHO Checking the environment...
|
||||
IF NOT EXIST "%INNOTOOL%" (
|
||||
ECHO !INNOTOOL! does not exist
|
||||
ECHO Please install Innotool and set the INNOTOOL environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%VCREDIST%" (
|
||||
ECHO !VCREDIST! does not exist
|
||||
ECHO Please install Microsoft Visual studio and set the VCREDIST environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%QTDIR%" (
|
||||
ECHO !QTDIR! does not exist.
|
||||
ECHO Please install Qt and set the QTDIR environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%QMAKE%" (
|
||||
ECHO !QMAKE! does not exist.
|
||||
ECHO Please install Qt and set the QTDIR environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%PYTHON_HOME%" (
|
||||
ECHO !PYTHON_HOME! does not exist.
|
||||
ECHO Please install Python and set the PYTHON_HOME environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%PYTHON_DLL%" (
|
||||
ECHO !PYTHON_DLL! does not exist.
|
||||
ECHO Please install Python and set the PYTHON_DLL environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%PGDIR%" (
|
||||
ECHO !PGDIR! does not exist.
|
||||
ECHO Please install PostgreSQL and set the PGDIR environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%PYTHON_HOME%\Scripts\virtualenv.exe" (
|
||||
ECHO !PYTHON_HOME!\Scripts\virtualenv.exe does not exist.
|
||||
ECHO Please install the virtualenv package in Python.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
SET "PATH=%PGDIR%\bin;%PATH%"
|
||||
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:CREATE_VIRTUAL_ENV
|
||||
ECHO Creating virtual environment...
|
||||
IF NOT EXIST "%PGBUILDPATH%" MKDIR "%PGBUILDPATH%"
|
||||
|
||||
REM If we're using VC++, and this is Python 3.6+, we need a hack for PyCrypto
|
||||
IF "%MAKE%" == "nmake" (
|
||||
IF %PYTHON_VERSION% GEQ 36 SET CL=-FI"%VCINSTALLDIR%\INCLUDE\stdint.h"
|
||||
)
|
||||
|
||||
CD "%PGBUILDPATH%"
|
||||
"%PYTHON_HOME%\Scripts\virtualenv.exe" "%VIRTUALENV%"
|
||||
|
||||
XCOPY /S /I /E /H /Y "%PYTHON_HOME%\DLLs" "%PGBUILDPATH%\%VIRTUALENV%\DLLs" > nul || EXIT /B 1
|
||||
XCOPY /S /I /E /H /Y "%PYTHON_HOME%\Lib" "%PGBUILDPATH%\%VIRTUALENV%\Lib" > nul || EXIT /B 1
|
||||
|
||||
ECHO Activating virtual environment - %PGBUILDPATH%\%VIRTUALENV%...
|
||||
CALL "%PGBUILDPATH%\%VIRTUALENV%\Scripts\activate" || EXIT /B 1
|
||||
|
||||
ECHO Installing dependencies...
|
||||
CALL pip install -r "%WD%\requirements.txt" || EXIT /B 1
|
||||
CALL pip install sphinx || EXIT /B 1
|
||||
|
||||
REM If we're using VC++, and this is Python 3.6+, we need to remove the hack
|
||||
REM above or it will break qmake. Sigh.
|
||||
IF "%MAKE%" == "nmake" (
|
||||
IF %PYTHON_VERSION% GEQ 36 SET CL=
|
||||
)
|
||||
|
||||
CD %WD%
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:CREATE_RUNTIME_ENV
|
||||
MKDIR "%PGBUILDPATH%\runtime"
|
||||
|
||||
CD "%WD%\web"
|
||||
|
||||
ECHO Installing javascript dependencies...
|
||||
CALL yarn install || EXIT /B 1
|
||||
|
||||
ECHO Bundling javascript...
|
||||
CALL yarn run bundle || EXIT /B 1
|
||||
|
||||
ECHO Removing webpack caches...
|
||||
RD /Q /S "%WD%\web\pgadmin\static\js\generated\.cache" 1> nul 2>&1
|
||||
|
||||
ECHO Copying web directory...
|
||||
XCOPY /S /I /E /H /Y "%WD%\web" "%PGBUILDPATH%\web" > nul || EXIT /B 1
|
||||
|
||||
ECHO Cleaning up unnecessary .pyc and .pyo files...
|
||||
FOR /R "%PGBUILDPATH%\web" %%f in (*.pyc *.pyo) do DEL /q "%%f" 1> nul 2>&1
|
||||
ECHO Removing tests, Python caches and node modules...
|
||||
FOR /R "%PGBUILDPATH%\web" %%f in (tests feature_tests __pycache__ node_modules) do RD /Q /S "%%f" 1> nul 2>&1
|
||||
ECHO Removing the test framework...
|
||||
RD /Q /S "%PGBUILDPATH%\web\regression" 1> nul 2>&1
|
||||
ECHO Removing tools...
|
||||
RD /Q /S "%PGBUILDPATH%\web\tools" 1> nul 2>&1
|
||||
ECHO Removing any existing configurations...
|
||||
DEL /q "%PGBUILDPATH%\web\pgadmin4.db" 1> nul 2>&1
|
||||
DEL /q "%PGBUILDPATH%\web\config_local.py" 1> nul 2>&1
|
||||
|
||||
ECHO Creating config_distro.py
|
||||
ECHO SERVER_MODE = False > "%PGBUILDPATH%\web\config_distro.py"
|
||||
ECHO HELP_PATH = '../../../docs/en_US/html/' >> "%PGBUILDPATH%\web\config_distro.py"
|
||||
ECHO DEFAULT_BINARY_PATHS = { >> "%PGBUILDPATH%\web\config_distro.py"
|
||||
ECHO 'pg': '$DIR/../runtime', >> "%PGBUILDPATH%\web\config_distro.py"
|
||||
ECHO 'ppas': '' >> "%PGBUILDPATH%\web\config_distro.py"
|
||||
ECHO } >> "%PGBUILDPATH%\web\config_distro.py"
|
||||
|
||||
ECHO Building docs...
|
||||
MKDIR "%PGBUILDPATH%\docs\en_US\html"
|
||||
CD "%WD%\docs\en_US"
|
||||
CALL "%PGBUILDPATH%\%VIRTUALENV%\Scripts\python.exe" build_code_snippet.py || EXIT /B 1
|
||||
CALL "%PGBUILDPATH%\%VIRTUALENV%\Scripts\sphinx-build.exe" "%WD%\docs\en_US" "%PGBUILDPATH%\docs\en_US\html" || EXIT /B 1
|
||||
|
||||
ECHO Removing Sphinx
|
||||
CALL pip uninstall -y sphinx Pygments alabaster colorama docutils imagesize requests snowballstemmer
|
||||
|
||||
IF %PYTHON_MAJOR% == 2 (
|
||||
ECHO Fixing backports.csv for Python 2 by adding missing __init__.py
|
||||
type nul >> "%PGBUILDPATH%\%VIRTUALENV%\Lib\site-packages\backports\__init__.py"
|
||||
)
|
||||
|
||||
IF %PYTHON_MAJOR% == 3 (
|
||||
ECHO Fixing PyCrypto module for Python 3...
|
||||
CALL "%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%PGBUILDPATH%\%VIRTUALENV%\Lib\site-packages\Crypto\Random\OSRNG\nt.py" "-o" "%PGBUILDPATH%\%VIRTUALENV%\Lib\site-packages\Crypto\Random\OSRNG\nt.py.new" "-s" "import winrandom" -r "from . import winrandom"
|
||||
MOVE /Y "%PGBUILDPATH%\%VIRTUALENV%\Lib\site-packages\Crypto\Random\OSRNG\nt.py.new" "%PGBUILDPATH%\%VIRTUALENV%\Lib\site-packages\Crypto\Random\OSRNG\nt.py"
|
||||
)
|
||||
|
||||
ECHO Assembling runtime environment...
|
||||
CD "%WD%\runtime"
|
||||
|
||||
ECHO Running qmake...
|
||||
CALL "%QMAKE%" || EXIT /B 1
|
||||
|
||||
ECHO Cleaning the build directory...
|
||||
CALL %MAKE% clean || EXIT /B 1
|
||||
|
||||
ECHO Running make...
|
||||
CALL %MAKE% || EXIT /B 1
|
||||
|
||||
ECHO Staging pgAdmin4.exe...
|
||||
COPY "%WD%\runtime\release\pgAdmin4.exe" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
|
||||
ECHO Staging Qt components...
|
||||
COPY "%QTDIR%\bin\Qt5Core.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%QTDIR%\bin\Qt5Gui.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%QTDIR%\bin\Qt5Widgets.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%QTDIR%\bin\Qt5Network.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%QTDIR%\bin\libgcc_s_dw2-1.dll" COPY "%QTDIR%\bin\libgcc_s_dw2-1.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%QTDIR%\bin\libstdc++-6.dll" COPY "%QTDIR%\bin\libstdc++-6.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%QTDIR%\bin\libwinpthread-1.dll" COPY "%QTDIR%\bin\libwinpthread-1.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
MKDIR "%PGBUILDPATH%\runtime\platforms" > nul || EXIT /B 1
|
||||
COPY "%QTDIR%\plugins\platforms\qwindows.dll" "%PGBUILDPATH%\runtime\platforms" > nul || EXIT /B 1
|
||||
ECHO [Paths] > "%PGBUILDPATH%\runtime\qt.conf"
|
||||
ECHO Plugins=plugins >> "%PGBUILDPATH%\runtime\qt.conf"
|
||||
|
||||
ECHO Staging PostgreSQL components...
|
||||
COPY "%PGDIR%\bin\libpq.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%PGDIR%\bin\ssleay32.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%PGDIR%\bin\libeay32.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%PGDIR%\bin\libintl-*.dll" COPY "%PGDIR%\bin\libintl-*.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%PGDIR%\bin\libiconv-*.dll" COPY "%PGDIR%\bin\libiconv-*.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%PGDIR%\bin\zlib.dll" COPY "%PGDIR%\bin\zlib.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%PGDIR%\bin\zlib1.dll" COPY "%PGDIR%\bin\zlib1.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%PGDIR%\bin\pg_dump.exe" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%PGDIR%\bin\pg_dumpall.exe" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1L%
|
||||
COPY "%PGDIR%\bin\pg_restore.exe" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%PGDIR%\bin\psql.exe" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
|
||||
ECHO Staging VC++ runtime...
|
||||
MKDIR "%PGBUILDPATH%\installer" || EXIT /B 1
|
||||
COPY "%VCREDIST%" "%PGBUILDPATH%\installer" > nul || EXIT /B 1
|
||||
|
||||
CD %WD%
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:CREATE_PYTHON_ENV
|
||||
ECHO Staging Python...
|
||||
COPY %PYTHON_DLL% "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY %PYTHON_HOME%\python.exe "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY %PYTHON_HOME%\pythonw.exe "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
|
||||
ECHO Cleaning up unnecessary .pyc and .pyo files...
|
||||
FOR /R "%PGBUILDPATH%\%VIRTUALENV%" %%f in (*.pyc *.pyo) do DEL /q "%%f" 1> nul 2>&1
|
||||
ECHO Removing tests...
|
||||
FOR /R "%PGBUILDPATH%\%VIRTUALENV%\Lib" %%f in (test tests) do RD /Q /S "%%f" 1> nul 2>&1
|
||||
ECHO Removing TCL...
|
||||
RD /Q /S "%PGBUILDPATH%\%VIRTUALENV%\tcl" 1> nul 2>&1
|
||||
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:CREATE_INSTALLER
|
||||
ECHO Preparing for creation of windows installer...
|
||||
IF NOT EXIST "%TARGET_DIR%" MKDIR "%TARGET_DIR%"
|
||||
|
||||
ECHO Copying icon file...
|
||||
COPY "%WD%\pkg\win32\Resources\pgAdmin4.ico" "%PGBUILDPATH%" > nul || EXIT /B 1
|
||||
|
||||
CD "%WD%\pkg\win32"
|
||||
|
||||
ECHO Processing installer configuration script...
|
||||
CALL "%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in" "-o" "%WD%\pkg\win32\installer.iss.in_stage1" "-s" MYAPP_NAME -r """%APP_NAME%"""
|
||||
CALL "%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in_stage1" "-o" "%WD%\pkg\win32\installer.iss.in_stage2" "-s" MYAPP_FULLVERSION -r """%APP_VERSION%"""
|
||||
CALL "%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in_stage2" "-o" "%WD%\pkg\win32\installer.iss.in_stage3" "-s" MYAPP_VERSION -r """v%APP_MAJOR%"""
|
||||
|
||||
SET ARCMODE=
|
||||
IF "%ARCHITECTURE%"=="amd64" (
|
||||
set ARCMODE="x64"
|
||||
)
|
||||
CALL "%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in_stage3" "-o" "%WD%\pkg\win32\installer.iss.in_stage4" "-s" MYAPP_ARCHITECTURESMODE -r """%ARCMODE%"""
|
||||
CALL "%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in_stage4" "-o" "%WD%\pkg\win32\installer.iss" "-s" MYAPP_VCDIST -r """%VCREDISTNAME%"""
|
||||
|
||||
ECHO Cleaning up...
|
||||
DEL /s "%WD%\pkg\win32\installer.iss.in_stage*" > nul
|
||||
|
||||
ECHO Creating windows installer using INNO tool...
|
||||
CALL "%INNOTOOL%\ISCC.exe" /q "%WD%\pkg\win32\installer.iss" || EXIT /B 1
|
||||
|
||||
ECHO Renaming installer...
|
||||
MOVE "%WD%\pkg\win32\Output\Setup.exe" "%TARGET_DIR%\%INSTALLERNAME%" > nul || EXIT /B 1
|
||||
|
||||
ECHO Location - %TARGET_DIR%\%INSTALLERNAME%
|
||||
ECHO Installer generated successfully.
|
||||
|
||||
CD %WD%
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:SIGN_INSTALLER
|
||||
ECHO Attempting to sign the installer...
|
||||
CALL "%SIGNTOOL%" sign /t http://timestamp.verisign.com/scripts/timstamp.dll "%TARGET_DIR%\%INSTALLERNAME%"
|
||||
IF %ERRORLEVEL% NEQ 0 (
|
||||
ECHO.
|
||||
ECHO ************************************************************
|
||||
ECHO * Failed to sign the installer
|
||||
ECHO ************************************************************
|
||||
PAUSE
|
||||
)
|
||||
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:CLEANUP_ENV
|
||||
ECHO Cleaning the build environment...
|
||||
RD "%PGBUILDPATH%\%VIRTUALENV%\Include" /S /Q 1> nul 2>&1
|
||||
DEL /s "%PGBUILDPATH%\%VIRTUALENV%\pip-selfcheck.json" 1> nul 2>&1
|
||||
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:USAGE
|
||||
ECHO Invalid command line options.
|
||||
ECHO Usage: "Make.bat <x86 | clean>"
|
||||
ECHO.
|
||||
|
||||
EXIT /B 1
|
||||
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
|
||||
SET WD=%CD%
|
||||
SET "PGBUILDPATH=%WD%\win-build"
|
||||
|
||||
SET CMDOPTION=""
|
||||
IF "%1" == "clean" SET CMDOPTION="VALID"
|
||||
IF "%1" == "x86" SET CMDOPTION="VALID"
|
||||
|
||||
IF NOT %CMDOPTION%=="VALID" (
|
||||
GOTO USAGE
|
||||
)
|
||||
|
||||
SET ARCHITECTURE=%1
|
||||
|
||||
IF "%ARCHITECTURE%"=="clean" (
|
||||
CALL :CLEAN
|
||||
EXIT /B %ERRORLEVEL%
|
||||
)
|
||||
|
||||
|
||||
REM Main build sequence
|
||||
CALL :SET_ENVIRONMENT
|
||||
CALL :VALIDATE_ENVIRONMENT || EXIT /B 1
|
||||
CALL :CLEAN || EXIT /B 1
|
||||
CALL :CREATE_VIRTUAL_ENV || EXIT /B 1
|
||||
CALL :CREATE_RUNTIME_ENV || EXIT /B 1
|
||||
CALL :CREATE_PYTHON_ENV || EXIT /B 1
|
||||
CALL :CLEANUP_ENV || EXIT /B 1
|
||||
CALL :CREATE_INSTALLER || EXIT /B 1
|
||||
CALL :SIGN_INSTALLER || EXIT /B 1
|
||||
|
||||
EXIT /B %ERRORLEVEL%
|
||||
REM Main build sequence Ends
|
||||
|
||||
|
||||
:CLEAN
|
||||
ECHO Removing build directory...
|
||||
IF EXIST "%PGBUILDPATH%" RD "%PGBUILDPATH%" /S /Q > nul || EXIT /B 1
|
||||
|
||||
ECHO Removing temp build directory...
|
||||
IF EXIST "%WD%\pkg\win32\Output" rd "%WD%\pkg\win32\Output" /S /Q > nul || EXIT /B 1
|
||||
|
||||
ECHO Removing installer configuration script...
|
||||
IF EXIST DEL /q "%WD%\pkg\win32\installer.iss" > nul || EXIT /B 1
|
||||
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:SET_ENVIRONMENT
|
||||
ECHO Configuring the environment...
|
||||
IF "%PYTHON_HOME%" == "" SET "PYTHON_HOME=C:\Python27"
|
||||
IF "%PYTHON_DLL%" == "" SET "PYTHON_DLL=C:\Windows\SysWOW64\python27.dll"
|
||||
IF "%QTDIR%" == "" SET "QTDIR=C:\Qt\5.9.1\mingw53_32"
|
||||
IF "%MAKE%" == "" SET "MAKE=mingw32-make.exe"
|
||||
IF "%PGDIR%" == "" SET "PGDIR=C:\Program Files (x86)\PostgreSQL\10"
|
||||
IF "%INNOTOOL%" == "" SET "INNOTOOL=C:\Program Files (x86)\Inno Setup 5"
|
||||
IF "%VCREDIST%" == "" SET "VCREDIST=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\1033\vcredist_x86.exe"
|
||||
IF "%SIGNTOOL%" == "" SET "SIGNTOOL=C:\Program Files\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe"
|
||||
|
||||
REM Set VCREDISTNAME (the filename)
|
||||
for /f "delims=" %%i in ("%VCREDIST%") do set "VCREDISTNAME=%%~nxi"
|
||||
|
||||
REM Set additional variables we need
|
||||
SET "QMAKE=%QTDIR%\bin\qmake.exe"
|
||||
FOR /F "tokens=4,5 delims=. " %%a IN ('%QMAKE% -v ^| findstr /B /C:"Using Qt version "') DO SET QT_VERSION=%%a.%%b
|
||||
|
||||
SET "VIRTUALENV=venv"
|
||||
SET "TARGET_DIR=%WD%\dist"
|
||||
|
||||
FOR /F "tokens=3" %%a IN ('findstr /C:"APP_RELEASE =" %WD%\web\config.py') DO SET APP_MAJOR=%%a
|
||||
FOR /F "tokens=3" %%a IN ('findstr /C:"APP_REVISION =" %WD%\web\config.py') DO SET APP_MINOR=%%a
|
||||
FOR /F "tokens=3" %%a IN ('findstr /C:"APP_SUFFIX =" %WD%\web\config.py') DO SET APP_VERSION_SUFFIX=%%a
|
||||
REM remove single quote from the string
|
||||
SET APP_VERSION_SUFFIX=%APP_VERSION_SUFFIX:'=%
|
||||
SET APP_NAME=""
|
||||
FOR /F "tokens=2* DELims='" %%a IN ('findstr /C:"APP_NAME =" web\config.py') DO SET APP_NAME=%%a
|
||||
FOR /f "tokens=1 DELims=." %%G IN ('%PYTHON_HOME%/python.exe -c "print('%APP_NAME%'.lower().replace(' ', ''))"') DO SET APP_SHORTNAME=%%G
|
||||
SET APP_VERSION=%APP_MAJOR%.%APP_MINOR%
|
||||
SET INSTALLERNAME=%APP_SHORTNAME%-%APP_MAJOR%.%APP_MINOR%-%APP_VERSION_SUFFIX%-%ARCHITECTURE%.exe
|
||||
IF "%APP_VERSION_SUFFIX%" == "" SET INSTALLERNAME=%APP_SHORTNAME%-%APP_MAJOR%.%APP_MINOR%-%ARCHITECTURE%.exe
|
||||
|
||||
REM get Python version for the runtime build ex. 2.7.1 will be 27
|
||||
FOR /f "tokens=1 DELims=." %%G IN ('%PYTHON_HOME%/python.exe -c "import sys; print(sys.version.split(' ')[0])"') DO SET PYTHON_MAJOR=%%G
|
||||
FOR /f "tokens=2 DELims=." %%G IN ('%PYTHON_HOME%/python.exe -c "import sys; print(sys.version.split(' ')[0])"') DO SET PYTHON_MINOR=%%G
|
||||
SET "PYTHON_VERSION=%PYTHON_MAJOR%%PYTHON_MINOR%"
|
||||
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:VALIDATE_ENVIRONMENT
|
||||
ECHO ****************************************************************
|
||||
ECHO S U M M A R Y
|
||||
ECHO ****************************************************************
|
||||
ECHO Build path: %PGBUILDPATH%
|
||||
ECHO Output directory: %TARGET_DIR%
|
||||
ECHO Installer name: %INSTALLERNAME%
|
||||
ECHO.
|
||||
ECHO Python home: %PYTHON_HOME%
|
||||
ECHO Python DLL: %PYTHON_DLL%
|
||||
ECHO Python version: %PYTHON_VERSION%
|
||||
ECHO Python major version: %PYTHON_MAJOR%
|
||||
ECHO Python minor version: %PYTHON_MINOR%
|
||||
ECHO.
|
||||
ECHO Qt home: %QTDIR%
|
||||
ECHO qmake executable: %QMAKE%
|
||||
ECHO Qt version: %QT_VERSION%
|
||||
ECHO.
|
||||
ECHO PostgreSQL home: %PGDIR%
|
||||
ECHO.
|
||||
ECHO VC++ redistributable: %VCREDIST%
|
||||
ECHO VC++ redistributable file: %VCREDISTNAME%
|
||||
ECHO.
|
||||
ECHO innotool executable: %INNOTOOL%
|
||||
ECHO signtool executable: %SIGNTOOL%
|
||||
ECHO.
|
||||
ECHO App major version: %APP_MAJOR%
|
||||
ECHO App minor version: %APP_MINOR%
|
||||
ECHO App version: %APP_VERSION%
|
||||
ECHO App version suffix: %APP_VERSION_SUFFIX%
|
||||
ECHO App short name: %APP_SHORTNAME%
|
||||
ECHO App name: %APP_NAME%
|
||||
ECHO ****************************************************************
|
||||
|
||||
ECHO Checking the environment...
|
||||
IF NOT EXIST "%INNOTOOL%" (
|
||||
ECHO !INNOTOOL! does not exist
|
||||
ECHO Please install Innotool and set the INNOTOOL environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%VCREDIST%" (
|
||||
ECHO !VCREDIST! does not exist
|
||||
ECHO Please install Microsoft Visual studio and set the VCREDIST environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%QTDIR%" (
|
||||
ECHO !QTDIR! does not exist.
|
||||
ECHO Please install Qt and set the QTDIR environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%QMAKE%" (
|
||||
ECHO !QMAKE! does not exist.
|
||||
ECHO Please install Qt and set the QTDIR environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%PYTHON_HOME%" (
|
||||
ECHO !PYTHON_HOME! does not exist.
|
||||
ECHO Please install Python and set the PYTHON_HOME environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%PYTHON_DLL%" (
|
||||
ECHO !PYTHON_DLL! does not exist.
|
||||
ECHO Please install Python and set the PYTHON_DLL environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%PGDIR%" (
|
||||
ECHO !PGDIR! does not exist.
|
||||
ECHO Please install PostgreSQL and set the PGDIR environment variable.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
IF NOT EXIST "%PYTHON_HOME%\Scripts\virtualenv.exe" (
|
||||
ECHO !PYTHON_HOME!\Scripts\virtualenv.exe does not exist.
|
||||
ECHO Please install the virtualenv package in Python.
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
SET "PATH=%PGDIR%\bin;%PATH%"
|
||||
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:CREATE_VIRTUAL_ENV
|
||||
ECHO Creating virtual environment...
|
||||
IF NOT EXIST "%PGBUILDPATH%" MKDIR "%PGBUILDPATH%"
|
||||
|
||||
CD "%PGBUILDPATH%"
|
||||
"%PYTHON_HOME%\Scripts\virtualenv.exe" "%VIRTUALENV%"
|
||||
|
||||
XCOPY /S /I /E /H /Y "%PYTHON_HOME%\DLLs" "%PGBUILDPATH%\%VIRTUALENV%\DLLs" > nul || EXIT /B 1
|
||||
XCOPY /S /I /E /H /Y "%PYTHON_HOME%\Lib" "%PGBUILDPATH%\%VIRTUALENV%\Lib" > nul || EXIT /B 1
|
||||
|
||||
ECHO Activating virtual environment - %PGBUILDPATH%\%VIRTUALENV%...
|
||||
CALL "%PGBUILDPATH%\%VIRTUALENV%\Scripts\activate" || EXIT /B 1
|
||||
|
||||
ECHO Installing dependencies...
|
||||
CALL pip install -r "%WD%\requirements.txt" || EXIT /B 1
|
||||
CALL pip install sphinx || EXIT /B 1
|
||||
|
||||
REM If we're using VC++, and this is Python 3.6+, we need to remove the hack
|
||||
REM above or it will break qmake. Sigh.
|
||||
IF "%MAKE%" == "nmake" (
|
||||
IF %PYTHON_VERSION% GEQ 36 SET CL=
|
||||
)
|
||||
|
||||
CD %WD%
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:CREATE_RUNTIME_ENV
|
||||
MKDIR "%PGBUILDPATH%\runtime"
|
||||
|
||||
CD "%WD%\web"
|
||||
|
||||
ECHO Installing javascript dependencies...
|
||||
CALL yarn install || EXIT /B 1
|
||||
|
||||
ECHO Bundling javascript...
|
||||
CALL yarn run bundle || EXIT /B 1
|
||||
|
||||
ECHO Removing webpack caches...
|
||||
RD /Q /S "%WD%\web\pgadmin\static\js\generated\.cache" 1> nul 2>&1
|
||||
|
||||
ECHO Copying web directory...
|
||||
XCOPY /S /I /E /H /Y "%WD%\web" "%PGBUILDPATH%\web" > nul || EXIT /B 1
|
||||
|
||||
ECHO Cleaning up unnecessary .pyc and .pyo files...
|
||||
FOR /R "%PGBUILDPATH%\web" %%f in (*.pyc *.pyo) do DEL /q "%%f" 1> nul 2>&1
|
||||
ECHO Removing tests, Python caches and node modules...
|
||||
FOR /R "%PGBUILDPATH%\web" %%f in (tests feature_tests __pycache__ node_modules) do RD /Q /S "%%f" 1> nul 2>&1
|
||||
ECHO Removing the test framework...
|
||||
RD /Q /S "%PGBUILDPATH%\web\regression" 1> nul 2>&1
|
||||
ECHO Removing tools...
|
||||
RD /Q /S "%PGBUILDPATH%\web\tools" 1> nul 2>&1
|
||||
ECHO Removing any existing configurations...
|
||||
DEL /q "%PGBUILDPATH%\web\pgadmin4.db" 1> nul 2>&1
|
||||
DEL /q "%PGBUILDPATH%\web\config_local.py" 1> nul 2>&1
|
||||
|
||||
ECHO Creating config_distro.py
|
||||
ECHO SERVER_MODE = False > "%PGBUILDPATH%\web\config_distro.py"
|
||||
ECHO HELP_PATH = '../../../docs/en_US/html/' >> "%PGBUILDPATH%\web\config_distro.py"
|
||||
ECHO DEFAULT_BINARY_PATHS = { >> "%PGBUILDPATH%\web\config_distro.py"
|
||||
ECHO 'pg': '$DIR/../runtime', >> "%PGBUILDPATH%\web\config_distro.py"
|
||||
ECHO 'ppas': '' >> "%PGBUILDPATH%\web\config_distro.py"
|
||||
ECHO } >> "%PGBUILDPATH%\web\config_distro.py"
|
||||
|
||||
ECHO Building docs...
|
||||
MKDIR "%PGBUILDPATH%\docs\en_US\html"
|
||||
CD "%WD%\docs\en_US"
|
||||
CALL "%PGBUILDPATH%\%VIRTUALENV%\Scripts\python.exe" build_code_snippet.py || EXIT /B 1
|
||||
CALL "%PGBUILDPATH%\%VIRTUALENV%\Scripts\sphinx-build.exe" "%WD%\docs\en_US" "%PGBUILDPATH%\docs\en_US\html" || EXIT /B 1
|
||||
|
||||
ECHO Removing Sphinx
|
||||
CALL pip uninstall -y sphinx Pygments alabaster colorama docutils imagesize requests snowballstemmer
|
||||
|
||||
ECHO Assembling runtime environment...
|
||||
CD "%WD%\runtime"
|
||||
|
||||
ECHO Running qmake...
|
||||
CALL "%QMAKE%" || EXIT /B 1
|
||||
|
||||
ECHO Cleaning the build directory...
|
||||
CALL %MAKE% clean || EXIT /B 1
|
||||
|
||||
ECHO Running make...
|
||||
CALL %MAKE% || EXIT /B 1
|
||||
|
||||
ECHO Staging pgAdmin4.exe...
|
||||
COPY "%WD%\runtime\release\pgAdmin4.exe" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
|
||||
ECHO Staging Qt components...
|
||||
COPY "%QTDIR%\bin\Qt5Core.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%QTDIR%\bin\Qt5Gui.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%QTDIR%\bin\Qt5Widgets.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%QTDIR%\bin\Qt5Network.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%QTDIR%\bin\libgcc_s_dw2-1.dll" COPY "%QTDIR%\bin\libgcc_s_dw2-1.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%QTDIR%\bin\libstdc++-6.dll" COPY "%QTDIR%\bin\libstdc++-6.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%QTDIR%\bin\libwinpthread-1.dll" COPY "%QTDIR%\bin\libwinpthread-1.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
MKDIR "%PGBUILDPATH%\runtime\platforms" > nul || EXIT /B 1
|
||||
COPY "%QTDIR%\plugins\platforms\qwindows.dll" "%PGBUILDPATH%\runtime\platforms" > nul || EXIT /B 1
|
||||
ECHO [Paths] > "%PGBUILDPATH%\runtime\qt.conf"
|
||||
ECHO Plugins=plugins >> "%PGBUILDPATH%\runtime\qt.conf"
|
||||
|
||||
ECHO Staging PostgreSQL components...
|
||||
COPY "%PGDIR%\bin\libpq.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%PGDIR%\bin\ssleay32.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%PGDIR%\bin\libeay32.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%PGDIR%\bin\libintl-*.dll" COPY "%PGDIR%\bin\libintl-*.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%PGDIR%\bin\libiconv-*.dll" COPY "%PGDIR%\bin\libiconv-*.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%PGDIR%\bin\zlib.dll" COPY "%PGDIR%\bin\zlib.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
IF EXIST "%PGDIR%\bin\zlib1.dll" COPY "%PGDIR%\bin\zlib1.dll" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%PGDIR%\bin\pg_dump.exe" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%PGDIR%\bin\pg_dumpall.exe" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1L%
|
||||
COPY "%PGDIR%\bin\pg_restore.exe" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY "%PGDIR%\bin\psql.exe" "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
|
||||
ECHO Staging VC++ runtime...
|
||||
MKDIR "%PGBUILDPATH%\installer" || EXIT /B 1
|
||||
COPY "%VCREDIST%" "%PGBUILDPATH%\installer" > nul || EXIT /B 1
|
||||
|
||||
CD %WD%
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:CREATE_PYTHON_ENV
|
||||
ECHO Staging Python...
|
||||
COPY %PYTHON_DLL% "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY %PYTHON_HOME%\python.exe "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
COPY %PYTHON_HOME%\pythonw.exe "%PGBUILDPATH%\runtime" > nul || EXIT /B 1
|
||||
|
||||
ECHO Cleaning up unnecessary .pyc and .pyo files...
|
||||
FOR /R "%PGBUILDPATH%\%VIRTUALENV%" %%f in (*.pyc *.pyo) do DEL /q "%%f" 1> nul 2>&1
|
||||
ECHO Removing tests...
|
||||
FOR /R "%PGBUILDPATH%\%VIRTUALENV%\Lib" %%f in (test tests) do RD /Q /S "%%f" 1> nul 2>&1
|
||||
ECHO Removing TCL...
|
||||
RD /Q /S "%PGBUILDPATH%\%VIRTUALENV%\tcl" 1> nul 2>&1
|
||||
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:CREATE_INSTALLER
|
||||
ECHO Preparing for creation of windows installer...
|
||||
IF NOT EXIST "%TARGET_DIR%" MKDIR "%TARGET_DIR%"
|
||||
|
||||
ECHO Copying icon file...
|
||||
COPY "%WD%\pkg\win32\Resources\pgAdmin4.ico" "%PGBUILDPATH%" > nul || EXIT /B 1
|
||||
|
||||
CD "%WD%\pkg\win32"
|
||||
|
||||
ECHO Processing installer configuration script...
|
||||
CALL "%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in" "-o" "%WD%\pkg\win32\installer.iss.in_stage1" "-s" MYAPP_NAME -r """%APP_NAME%"""
|
||||
CALL "%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in_stage1" "-o" "%WD%\pkg\win32\installer.iss.in_stage2" "-s" MYAPP_FULLVERSION -r """%APP_VERSION%"""
|
||||
CALL "%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in_stage2" "-o" "%WD%\pkg\win32\installer.iss.in_stage3" "-s" MYAPP_VERSION -r """v%APP_MAJOR%"""
|
||||
|
||||
SET ARCMODE=
|
||||
IF "%ARCHITECTURE%"=="amd64" (
|
||||
set ARCMODE="x64"
|
||||
)
|
||||
CALL "%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in_stage3" "-o" "%WD%\pkg\win32\installer.iss.in_stage4" "-s" MYAPP_ARCHITECTURESMODE -r """%ARCMODE%"""
|
||||
CALL "%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%WD%\pkg\win32\installer.iss.in_stage4" "-o" "%WD%\pkg\win32\installer.iss" "-s" MYAPP_VCDIST -r """%VCREDISTNAME%"""
|
||||
|
||||
ECHO Cleaning up...
|
||||
DEL /s "%WD%\pkg\win32\installer.iss.in_stage*" > nul
|
||||
|
||||
ECHO Creating windows installer using INNO tool...
|
||||
CALL "%INNOTOOL%\ISCC.exe" /q "%WD%\pkg\win32\installer.iss" || EXIT /B 1
|
||||
|
||||
ECHO Renaming installer...
|
||||
MOVE "%WD%\pkg\win32\Output\Setup.exe" "%TARGET_DIR%\%INSTALLERNAME%" > nul || EXIT /B 1
|
||||
|
||||
ECHO Location - %TARGET_DIR%\%INSTALLERNAME%
|
||||
ECHO Installer generated successfully.
|
||||
|
||||
CD %WD%
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:SIGN_INSTALLER
|
||||
ECHO Attempting to sign the installer...
|
||||
CALL "%SIGNTOOL%" sign /t http://timestamp.verisign.com/scripts/timstamp.dll "%TARGET_DIR%\%INSTALLERNAME%"
|
||||
IF %ERRORLEVEL% NEQ 0 (
|
||||
ECHO.
|
||||
ECHO ************************************************************
|
||||
ECHO * Failed to sign the installer
|
||||
ECHO ************************************************************
|
||||
PAUSE
|
||||
)
|
||||
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:CLEANUP_ENV
|
||||
ECHO Cleaning the build environment...
|
||||
RD "%PGBUILDPATH%\%VIRTUALENV%\Include" /S /Q 1> nul 2>&1
|
||||
DEL /s "%PGBUILDPATH%\%VIRTUALENV%\pip-selfcheck.json" 1> nul 2>&1
|
||||
|
||||
EXIT /B 0
|
||||
|
||||
|
||||
:USAGE
|
||||
ECHO Invalid command line options.
|
||||
ECHO Usage: "Make.bat <x86 | clean>"
|
||||
ECHO.
|
||||
|
||||
EXIT /B 1
|
||||
|
||||
@@ -27,7 +27,7 @@ Building the Runtime
|
||||
To build the runtime, the following packages must be installed:
|
||||
|
||||
- QT 4.6 or above
|
||||
- Python 2.6, 2.7 or 3.3+ (2.7 only on Windows)
|
||||
- Python 2.7 or 3.4+
|
||||
|
||||
Assuming both qmake and python-config are in the path:
|
||||
|
||||
@@ -88,7 +88,7 @@ Configuring the Python Environment
|
||||
----------------------------------
|
||||
|
||||
In order to run the Python code, a suitable runtime environment is required.
|
||||
Python versions - Python 2.6, 2.7 or 3.3+ are currently supported. It is
|
||||
Python versions - Python 2.7 or 3.4+ are currently supported. It is
|
||||
recommended that a Python Virtual Environment is setup for this purpose,
|
||||
rather than using the system Python environment. On Linux and Mac systems, the
|
||||
process is fairly simple - adapt as required for your distribution:
|
||||
|
||||
@@ -113,6 +113,8 @@ When you’ve specified the details that will be incorporated into the pg_dump c
|
||||
.. image:: images/backup_messages.png
|
||||
:alt: Backup success notification popup
|
||||
|
||||
Use the **Stop Process** button to stop the Backup process.
|
||||
|
||||
If the backup is successful, a popup window will confirm success. Click *Click here for details* on the popup window to launch the *Process Watcher*. The *Process Watcher* logs all the activity associated with the backup and provides additional information for troubleshooting.
|
||||
|
||||
.. image:: images/backup_process_watcher.png
|
||||
|
||||
@@ -24,6 +24,8 @@ Click the *Backup* button to build and execute a command based on your selection
|
||||
.. image:: images/backup_globals_messages.png
|
||||
:alt: Backup globals success notification popup
|
||||
|
||||
Use the **Stop Process** button to stop the Backup process.
|
||||
|
||||
If the backup is successful, a popup window will confirm success. Click *Click here for details* on the popup window to launch the *Process Watcher*. The *Process Watcher* logs all the activity associated with the backup and provides additional information for troubleshooting.
|
||||
|
||||
.. image:: images/backup_globals_process_watcher.png
|
||||
|
||||
@@ -78,6 +78,8 @@ Click the *Backup* button to build and execute a command based on your selection
|
||||
.. image:: images/backup_server_messages.png
|
||||
:alt: Backup server success notification popup
|
||||
|
||||
Use the **Stop Process** button to stop the Backup process.
|
||||
|
||||
If the backup is successful, a popup window will confirm success. Click *Click here for details* on the popup window to launch the *Process Watcher*. The *Process Watcher* logs all the activity associated with the backup and provides additional information for troubleshooting.
|
||||
|
||||
.. image:: images/backup_server_process_watcher.png
|
||||
|
||||
@@ -16,7 +16,7 @@ review process for any patches submitted for inclusion in pgAdmin.
|
||||
bulk updates every year). The start date should always be 2013, and the end year
|
||||
the current year, e.g.
|
||||
|
||||
Copyright (C) 2013 - 2018, The pgAdmin Development Team
|
||||
Copyright (C) 2013 - 2019, The pgAdmin Development Team
|
||||
|
||||
* Ensure there's a blank line immediately following any copyright headers.
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ with the required file header is shown below::
|
||||
#
|
||||
# pgAdmin 4 - PostgreSQL Tools
|
||||
#
|
||||
# Copyright (C) 2013 - 2018, The pgAdmin Development Team
|
||||
# Copyright (C) 2013 - 2019, The pgAdmin Development Team
|
||||
# This software is released under the PostgreSQL Licence
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
@@ -42,7 +42,7 @@ The following is an example of the sql command generated by user selections in t
|
||||
.. image:: images/collation_sql.png
|
||||
:alt: Collation dialog sql tab
|
||||
|
||||
The example shown demonstrates creating a collation named *french* that uses the rules specified for the locale, *fr_FR.utf8. The collation is owned by *postgres*.
|
||||
The example shown demonstrates creating a collation named *french* that uses the rules specified for the locale, *fr-BI-x-icu. The collation is owned by *postgres*.
|
||||
|
||||
* Click the *Info* button (i) to access online help. View context-sensitive help in the *Tabbed browser*, where a new tab displays the PostgreSQL core documentation. For more information about setting a locale, see Chapter 22.1 Locale Support of the PostgreSQL core documentation:
|
||||
|
||||
|
||||
@@ -111,13 +111,16 @@ html_theme = 'classic'
|
||||
# documentation.
|
||||
html_theme_options = {
|
||||
'collapsiblesidebar': True,
|
||||
'relbarbgcolor': '#2C76B4',
|
||||
'relbarbgcolor': '#326690',
|
||||
'sidebarbgcolor': '#E2E2E2',
|
||||
'sidebarbtncolor': '#2C76B4',
|
||||
'sidebartextcolor': '#000',
|
||||
'sidebarlinkcolor': '#337AB7',
|
||||
'footerbgcolor': '#333',
|
||||
'codebgcolor': '#D9EDF7',
|
||||
'sidebarbtncolor': '#326690',
|
||||
'sidebartextcolor': '#222222',
|
||||
'sidebarlinkcolor': '#326690',
|
||||
'footerbgcolor': '#222222',
|
||||
'codebgcolor': '#d6effc',
|
||||
'textcolor': '#222222',
|
||||
'headbgcolor': '#E2E2E2',
|
||||
'headtextcolor': '#326690',
|
||||
'bodyfont': '"Helvetica Neue", Helvetica, Arial, sans-serif',
|
||||
'headfont': '"Helvetica Neue", Helvetica, Arial, sans-serif'
|
||||
}
|
||||
|
||||
@@ -4,7 +4,12 @@
|
||||
`Connecting to a Server`:index:
|
||||
*******************************
|
||||
|
||||
Before you can use the pgAdmin client to manage the objects that reside on your Postgres server, you must define a connection to the server. You can (optionally) use the *Server Group* dialog to create server groups to organize the server connections within the tree control for easier management. To open the *Server Group* dialog, right-click on the *Servers* node of the tree control, and select *Server Group* from the *Create* menu.
|
||||
Before you can use the pgAdmin client to manage the objects that reside on your
|
||||
Postgres server, you must define a connection to the server. You can
|
||||
(optionally) use the *Server Group* dialog to create server groups to organize
|
||||
the server connections within the tree control for easier management. To open
|
||||
the *Server Group* dialog, right-click on the *Servers* node of the tree
|
||||
control, and select *Server Group* from the *Create* menu.
|
||||
|
||||
Contents:
|
||||
|
||||
@@ -12,7 +17,10 @@ Contents:
|
||||
|
||||
server_group_dialog
|
||||
|
||||
Use the fields on the *Server* dialog to define the connection properties for each new server that you wish to manage with pgAdmin. To open the *Server* dialog, right-click on the *Servers* node of the tree control, and select *Server* from the *Create* menu.
|
||||
Use the fields on the *Server* dialog to define the connection properties for
|
||||
each new server that you wish to manage with pgAdmin. To open the *Server*
|
||||
dialog, right-click on the *Servers* node of the tree control, and select
|
||||
*Server* from the *Create* menu.
|
||||
|
||||
Contents:
|
||||
|
||||
@@ -20,11 +28,21 @@ Contents:
|
||||
|
||||
server_dialog
|
||||
|
||||
After defining a server connection, right-click on the server name, and select *Connect to server* to authenticate with the server, and start using pgAdmin to manage objects that reside on the server.
|
||||
After defining a server connection, right-click on the server name, and select
|
||||
*Connect to server* to authenticate with the server, and start using pgAdmin to
|
||||
manage objects that reside on the server.
|
||||
|
||||
Contents:
|
||||
|
||||
.. toctree::
|
||||
|
||||
connect_to_server
|
||||
connect_error
|
||||
connect_error
|
||||
|
||||
Server definitions (and their groups) can be exported to a JSON file and
|
||||
re-imported to the same or a different system to enable easy pre-configuration
|
||||
of pgAdmin.
|
||||
|
||||
.. toctree::
|
||||
|
||||
export_import_servers
|
||||
@@ -0,0 +1,143 @@
|
||||
.. _container_deployment:
|
||||
|
||||
**************************************
|
||||
`Container Deployment`:index:
|
||||
**************************************
|
||||
|
||||
pgAdmin can be deployed in a container using the image at:
|
||||
|
||||
https://hub.docker.com/r/dpage/pgadmin4/
|
||||
|
||||
PostgreSQL Utilities
|
||||
********************
|
||||
|
||||
The PostgreSQL utilities *pg_dump*, *pg_dumpall*, *pg_restore* and *psql* are
|
||||
included in the container to allow backups to be created and restored and other
|
||||
maintenance functions to be executed. Multiple versions are included in the
|
||||
following directories to allow use with different versions of the database
|
||||
server:
|
||||
|
||||
* PostgreSQL 9.4: /usr/local/pgsql-9.4
|
||||
* PostgreSQL 9.5: /usr/local/pgsql-9.5
|
||||
* PostgreSQL 9.6: /usr/local/pgsql-9.6
|
||||
* PostgreSQL 10: /usr/local/pgsql-10
|
||||
* PostgreSQL 11: /usr/local/pgsql-11
|
||||
|
||||
The most recent version of the utilities is used by default; this may be
|
||||
changed in the :ref:`preferences`.
|
||||
|
||||
Environment Variables
|
||||
*********************
|
||||
|
||||
The container will accept the following variables at startup:
|
||||
|
||||
*PGADMIN_DEFAULT_EMAIL*
|
||||
|
||||
This is the email address used when setting up the initial administrator account
|
||||
to login to pgAdmin. This variable is required and must be set at launch time.
|
||||
|
||||
*PGADMIN_DEFAULT_PASSWORD*
|
||||
|
||||
This is the password used when setting up the initial administrator account to
|
||||
login to pgAdmin. This variable is required and must be set at launch time.
|
||||
|
||||
*PGADMIN_ENABLE_TLS*
|
||||
|
||||
Default: <null>
|
||||
|
||||
If left un-set, the container will listen on port 80 for connections in plain
|
||||
text. If set to any value, the container will listen on port 443 for TLS
|
||||
connections.
|
||||
|
||||
When TLS is enabled, a certificate and key must be provided. Typically these
|
||||
should be stored on the host file system and mounted from the container. The
|
||||
expected paths are /certs/server.crt and /certs/server.key
|
||||
|
||||
*PGADMIN_LISTEN_ADDRESS*
|
||||
|
||||
Default: [::]
|
||||
|
||||
Specify the local address that the servers listens on. The default should work
|
||||
for most users - in IPv4-only environments, this may need to be set to
|
||||
127.0.0.1.
|
||||
|
||||
*PGADMIN_LISTEN_PORT*
|
||||
|
||||
Default: 80 or 443 (if TLS is enabled)
|
||||
|
||||
Allows the port that the server listens on to be set to a specific value rather
|
||||
than using the default.
|
||||
|
||||
*GUNICORN_THREADS*
|
||||
|
||||
Default: 25
|
||||
|
||||
Adjust the number of threads the Gunicorn server uses to handle incoming
|
||||
requests. This should typically be left as-is, except in highly loaded systems
|
||||
where it may be increased.
|
||||
|
||||
Mapped Files and Directories
|
||||
****************************
|
||||
|
||||
The following files or directories can be mapped from the container onto the
|
||||
host machine to allow configuration to be customised and shared between
|
||||
instances:
|
||||
|
||||
*/var/lib/pgadmin*
|
||||
|
||||
This is the working directory in which pgAdmin stores session data, user files,
|
||||
configuration files, and it's configuration database. Mapping this directory
|
||||
onto the host machine gives you an easy way to maintain configuration between
|
||||
|
||||
invocations of the container.
|
||||
|
||||
*/pgadmin4/config_local.py*
|
||||
|
||||
This file can be used to override configuration settings in pgAdmin. Settings
|
||||
found in config.py can be overridden with deployment specific values if
|
||||
required.
|
||||
|
||||
*/pgadmin4/servers.json*
|
||||
|
||||
If this file is mapped, server definitions found in it will be loaded at launch
|
||||
time. This allows connection information to be pre-loaded into the instance of
|
||||
pgAdmin in the container.
|
||||
|
||||
*/certs/server.cert*
|
||||
|
||||
If TLS is enabled, this file will be used as the servers TLS certificate.
|
||||
|
||||
*/certs/server.key*
|
||||
|
||||
If TLS is enabled, this file will be used as the key file for the servers TLS
|
||||
certificate.
|
||||
|
||||
Examples
|
||||
********
|
||||
|
||||
Run a simple container over port 80:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker pull dpage/pgadmin4
|
||||
docker run -p 80:80 \
|
||||
-e "PGADMIN_DEFAULT_EMAIL=user@domain.com" \
|
||||
-e "PGADMIN_DEFAULT_PASSWORD=SuperSecret" \
|
||||
-d dpage/pgadmin4
|
||||
|
||||
Run a TLS secured container using a shared config/storage directory in
|
||||
/private/var/lib/pgadmin on the host, and servers pre-loaded from
|
||||
/tmp/servers.json on the host:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker pull dpage/pgadmin4
|
||||
docker run -p 443:443 \
|
||||
-v "/private/var/lib/pgadmin:/var/lib/pgadmin" \
|
||||
-v "/path/to/certificate.cert:/certs/server.cert" \
|
||||
-v "/path/to/certificate.key:/certs/server.key" \
|
||||
-v "/tmp/servers.json:/servers.json" \
|
||||
-e "PGADMIN_DEFAULT_EMAIL=user@domain.com" \
|
||||
-e "PGADMIN_DEFAULT_PASSWORD=SuperSecret" \
|
||||
-e "PGADMIN_ENABLE_TLS=True" \
|
||||
-d dpage/pgadmin4
|
||||
@@ -4,7 +4,11 @@
|
||||
`pgAdmin Deployment`:index:
|
||||
***************************
|
||||
|
||||
Pre-compiled and configured installation packages for pgAdmin 4 are available for a number of desktop environments; we recommend using an installer whenever possible. If you are interested in learning more about the project, or if a pgAdmin installer is not available for your environment, the pages listed below will provide detailed information about creating a custom deployment.
|
||||
Pre-compiled and configured installation packages for pgAdmin 4 are available
|
||||
for a number of desktop environments; we recommend using an installer whenever
|
||||
possible. If you are interested in learning more about the project, or if a
|
||||
pgAdmin installer is not available for your environment, the pages listed below
|
||||
will provide detailed information about creating a custom deployment.
|
||||
|
||||
Contents:
|
||||
|
||||
@@ -12,4 +16,5 @@ Contents:
|
||||
:maxdepth: 2
|
||||
|
||||
desktop_deployment
|
||||
server_deployment
|
||||
server_deployment
|
||||
container_deployment
|
||||
@@ -0,0 +1,117 @@
|
||||
.. _export_import_servers:
|
||||
|
||||
****************************************
|
||||
`Exporting and importing Servers`:index:
|
||||
****************************************
|
||||
|
||||
Server definitions (and their groups) can be exported to a JSON file and
|
||||
re-imported to the same or a different system to enable easy pre-configuration
|
||||
of pgAdmin. The ``setup.py`` script is used for this purpose.
|
||||
|
||||
.. note:: To export or import servers, you must use the Python interpreter that
|
||||
is normally used to run pgAdmin to ensure that the required Python
|
||||
packages are available. In most packages, this can be found in the
|
||||
Python Virtual Environment that can be found in the installation
|
||||
directory. When using platform-native packages, the system installation
|
||||
of Python may be the one used by pgAdmin.
|
||||
|
||||
**Exporting Servers**
|
||||
|
||||
To export the servers defined in an installation, simply invoke ``setup.py`` with
|
||||
the ``--dump-servers`` command line option, followed by the name (and if required,
|
||||
path) to the desired output file. By default, servers owned by the desktop mode
|
||||
user will be dumped (pgadmin4@pgadmin.org by default - see the DESKTOP_USER
|
||||
setting in ``config.py``). This can be overridden with the ``--user`` command
|
||||
line option. For example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
/path/to/python /path/to/setup.py --dump-servers output_file.json
|
||||
|
||||
# or, to specify a non-default user name:
|
||||
|
||||
/path/to/python /path/to/setup.py --dump-servers output_file.json --user user@example.com
|
||||
|
||||
To export only certain servers, use the ``--servers`` option and list one or
|
||||
more server IDs. For example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
/path/to/python /path/to/setup.py --dump-servers output_file.json --server 1 2 5
|
||||
|
||||
**Importing Servers**
|
||||
|
||||
To import the servers defined in a JSON file, simply invoke ``setup.py`` with
|
||||
the ``--load-servers`` command line option, followed by the name (and if required,
|
||||
path) of the JSON file containing the server definitions. Servers will be owned
|
||||
by the desktop mode user (pgadmin4@pgadmin.org by default - see the DESKTOP_USER
|
||||
setting in ``config.py``). This can be overridden with the ``--user`` command
|
||||
line option. For example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
/path/to/python /path/to/setup.py --load-servers input_file.json
|
||||
|
||||
# or, to specify a non-default user name to own the new servers:
|
||||
|
||||
/path/to/python /path/to/setup.py --load-servers input_file.json --user user@example.com
|
||||
|
||||
If any Servers are defined with a Server Group that is not already present in
|
||||
the configuration database, the required Group will be created.
|
||||
|
||||
**JSON format**
|
||||
|
||||
The JSON file format used when importing or exporting servers is quite
|
||||
straightforward and simply contains a list of servers, with a number of
|
||||
attributes. The following attributes are required to be present in every server
|
||||
definition: Name, Group, Port, Username, SSLMode, MaintenanceDB and one of Host,
|
||||
HostAddr or Service.
|
||||
|
||||
Password fields cannot be imported or exported.
|
||||
|
||||
The following example shows both a minimally defined and a fully defined server:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
{
|
||||
"Servers": {
|
||||
"1": {
|
||||
"Name": "Minimally Defined Server",
|
||||
"Group": "Server Group 1",
|
||||
"Port": 5432,
|
||||
"Username": "postgres",
|
||||
"Host": "localhost",
|
||||
"SSLMode": "prefer",
|
||||
"MaintenanceDB": "postgres"
|
||||
},
|
||||
"2": {
|
||||
"Name: "Fully Defined Server",
|
||||
"Group": "Server Group 2",
|
||||
"Host": "host.domain.com",
|
||||
"HostAddr": "192.168.1.2",
|
||||
"Port": 5432,
|
||||
"MaintenanceDB": "postgres",
|
||||
"Username": "postgres",
|
||||
"Role": "my_role_name",
|
||||
"SSLMode": "require",
|
||||
"Comment": "This server has every option configured in the JSON",
|
||||
"DBRestriction": "live_db test_db",
|
||||
"PassFile": "/path/to/pgpassfile",
|
||||
"SSLCert": "/path/to/sslcert.crt",
|
||||
"SSLKey": "/path/to/sslcert.key",
|
||||
"SSLRootCert": "/path/to/sslroot.crt",
|
||||
"SSLCrl": "/path/to/sslcrl.crl",
|
||||
"SSLCompression": 1,
|
||||
"BGColor": "#ff9900",
|
||||
"FGColor": "#000000",
|
||||
"Service": "postgresql-10",
|
||||
"Timeout": 60,
|
||||
"UseSSHTunnel": 1,
|
||||
"TunnelHost": "192.168.1.253",
|
||||
"TunnelPort": 22,
|
||||
"TunnelUsername": "username",
|
||||
"TunnelAuthentication": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ tool and the debugger). pgAdmin opens additional feature tabs each time you
|
||||
access the extended functionality offered by pgAdmin tools; you can open, close,
|
||||
and re-arrange feature tabs as needed.
|
||||
|
||||
Use the *Preferences* dialog to customize the content and colors of the pgAdmin
|
||||
Use the *Preferences* dialog to customize the content and behaviour of the pgAdmin
|
||||
display. To open the *Preferences* dialog, select *Preferences* from the *File* menu.
|
||||
|
||||
*Help* buttons in the lower-left corner of each dialog will open the online help
|
||||
@@ -74,16 +74,12 @@ Contents:
|
||||
|
||||
browser
|
||||
pgadmin_menu_bar
|
||||
pgadmin_toolbar
|
||||
pgadmin_tabbed_browser
|
||||
pgadmin_tree_control
|
||||
preferences
|
||||
keyboard_shortcuts
|
||||
|
||||
Before using pgAdmin to manage objects that reside on a server, you must define a
|
||||
connection to the server; for more information please see *Connecting to a Server*:
|
||||
|
||||
Contents:
|
||||
|
||||
.. toctree::
|
||||
|
||||
connecting
|
||||
connection to the server; for more information please see *Connecting to a Server*
|
||||
in the next section.
|
||||
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 244 KiB After Width: | Height: | Size: 299 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 188 KiB After Width: | Height: | Size: 166 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 244 KiB After Width: | Height: | Size: 184 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 344 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 26 KiB |