release.bat 2.3 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

if "%1" == "cluster" (
	set work_dir=%internal_dir%
	set packagServerName_x64=TDengine-enterprise-server-%2-beta-Windows-x64
wafwerar's avatar
wafwerar 已提交
14
	@REM set packagServerName_x86=TDengine-enterprise-server-%2-beta-Windows-x86
wafwerar's avatar
wafwerar 已提交
15 16 17 18 19
	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
wafwerar's avatar
wafwerar 已提交
20
	@REM set packagServerName_x86=TDengine-server-%2-Windows-x86
wafwerar's avatar
wafwerar 已提交
21 22 23 24 25 26 27 28 29 30
	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
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
wafwerar's avatar
wafwerar 已提交
43
cmake ../../ -G "NMake Makefiles JOM" -DCMAKE_MAKE_PROGRAM=jom -DBUILD_TOOLS=true -DBUILD_HTTP=false -BUILD_TEST=false -DVERNUMBER=%2 -DCPUTYPE=x64
wafwerar's avatar
wafwerar 已提交
44 45 46
cmake --build .
rd /s /Q C:\TDengine
cmake --install .
wafwerar's avatar
wafwerar 已提交
47 48
for /r c:\TDengine %%i in (*.dll) do signtool sign /f D:\\123.pfx /p taosdata %%i
for /r c:\TDengine %%i in (*.exe) do signtool sign /f D:\\123.pfx /p taosdata %%i
wafwerar's avatar
wafwerar 已提交
49 50 51 52 53 54 55
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)

wafwerar's avatar
wafwerar 已提交
56
for /r ..\release %%i in (*.exe) do signtool sign /f d:\\123.pfx /p taosdata %%i
wafwerar's avatar
wafwerar 已提交
57 58 59
goto EXIT0

:USAGE
wafwerar's avatar
wafwerar 已提交
60
echo Usage: release.bat $verMode $version
wafwerar's avatar
wafwerar 已提交
61 62
goto EXIT0

wafwerar's avatar
wafwerar 已提交
63 64 65 66 67 68 69
:EXIT0
exit /b

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