release.bat 2.8 KB
Newer Older
wafwerar's avatar
wafwerar 已提交
1 2 3 4
@echo off

set internal_dir=%~dp0\..\..\
set community_dir=%~dp0\..
wafwerar's avatar
wafwerar 已提交
5
set package_dir=%cd%
wafwerar's avatar
wafwerar 已提交
6 7 8 9

:: %1 name %2 version
if !%1==! GOTO USAGE
if !%2==! GOTO USAGE
wafwerar's avatar
wafwerar 已提交
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

if "%1" == "cluster" (
	set work_dir=%internal_dir%
	set packagServerName_x64=TDengine-enterprise-server-%2-beta-Windows-x64
	set packagServerName_x86=TDengine-enterprise-server-%2-beta-Windows-x86
	set packagClientName_x64=TDengine-enterprise-client-%2-beta-Windows-x64
	set packagClientName_x86=TDengine-enterprise-client-%2-beta-Windows-x86
) else (
	set work_dir=%community_dir%
	set packagServerName_x64=TDengine-server-%2-Windows-x64
	set packagServerName_x86=TDengine-server-%2-Windows-x86
	set packagClientName_x64=TDengine-client-%2-Windows-x64
	set packagClientName_x86=TDengine-client-%2-Windows-x86
)

echo release windows-client for %1, version: %2
if not exist %work_dir%\debug (
	md %work_dir%\debug
)
if not exist %work_dir%\debug\ver-%2-x64 (
	md %work_dir%\debug\ver-%2-x64
wafwerar's avatar
wafwerar 已提交
31
) else (
wafwerar's avatar
wafwerar 已提交
32 33
	rd /S /Q %work_dir%\debug\ver-%2-x64
	md %work_dir%\debug\ver-%2-x64
wafwerar's avatar
wafwerar 已提交
34
)
wafwerar's avatar
wafwerar 已提交
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
if not exist %work_dir%\debug\ver-%2-x86 (
	md %work_dir%\debug\ver-%2-x86
) else (
	rd /S /Q %work_dir%\debug\ver-%2-x86
	md %work_dir%\debug\ver-%2-x86
)
cd %work_dir%\debug\ver-%2-x64
call vcvarsall.bat x64
cmake ../../ -G "NMake Makefiles JOM" -DCMAKE_MAKE_PROGRAM=jom -DBUILD_TOOLS=true -DBUILD_HTTP=false -DVERNUMBER=%2 -DCPUTYPE=x64
cmake --build .
rd /s /Q C:\TDengine
cmake --install .
if not %errorlevel% == 0  ( call :RUNFAILED build x64 failed & exit /b 1)
cd %package_dir%
iscc /DMyAppInstallName="%packagServerName_x64%" /DMyAppVersion="%2" /DMyAppExcludeSource="" tools\tdengine.iss /O..\release
if not %errorlevel% == 0  ( call :RUNFAILED package %packagServerName_x64% failed & exit /b 1)
iscc /DMyAppInstallName="%packagClientName_x64%" /DMyAppVersion="%2" /DMyAppExcludeSource="taosd.exe" tools\tdengine.iss /O..\release
if not %errorlevel% == 0  ( call :RUNFAILED package %packagClientName_x64% failed & exit /b 1)

cd %work_dir%\debug\ver-%2-x86
call vcvarsall.bat x86
cmake ../../ -G "NMake Makefiles JOM" -DCMAKE_MAKE_PROGRAM=jom -DBUILD_TOOLS=true -DBUILD_HTTP=false -DVERNUMBER=%2 -DCPUTYPE=x86
cmake --build .
rd /s /Q C:\TDengine
cmake --install .
if not %errorlevel% == 0  ( call :RUNFAILED build x86 failed & exit /b 1)
cd %package_dir%
iscc /DMyAppInstallName="%packagServerName_x86%" /DMyAppVersion="%2" /DMyAppExcludeSource="" tools\tdengine.iss /O..\release
if not %errorlevel% == 0  ( call :RUNFAILED package %packagServerName_x86% failed & exit /b 1)
iscc /DMyAppInstallName="%packagClientName_x86%" /DMyAppVersion="%2" /DMyAppExcludeSource="taosd.exe" tools\tdengine.iss /O..\release
if not %errorlevel% == 0  ( call :RUNFAILED package %packagClientName_x86% failed & exit /b 1)

wafwerar's avatar
wafwerar 已提交
67 68 69
goto EXIT0

:USAGE
wafwerar's avatar
wafwerar 已提交
70
echo Usage: release.bat $verMode $version
wafwerar's avatar
wafwerar 已提交
71 72
goto EXIT0

wafwerar's avatar
wafwerar 已提交
73 74 75 76 77 78 79
:EXIT0
exit /b

:RUNFAILED
echo %*
cd %package_dir%
goto :eof