mirror of https://github.com/tp4a/teleport
开始调整自动构建脚本
parent
13b9a1ef17
commit
40619185a7
|
@ -47,7 +47,7 @@ class BuilderBase:
|
||||||
class BuilderWin(BuilderBase):
|
class BuilderWin(BuilderBase):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.name = 'teleport-server-windows-{}-{}'.format(ctx.bits_path, VER_TELEPORT_SERVER)
|
self.name = 'teleport-server-windows-{}-{}'.format(ctx.bits_path, VER_TP_WEB_SERVER)
|
||||||
self._final_file = os.path.join(env.root_path, 'out', 'installer', '{}.zip'.format(self.name))
|
self._final_file = os.path.join(env.root_path, 'out', 'installer', '{}.zip'.format(self.name))
|
||||||
|
|
||||||
self.dist_path = os.path.join(env.root_path, 'dist', 'server')
|
self.dist_path = os.path.join(env.root_path, 'dist', 'server')
|
||||||
|
@ -92,7 +92,7 @@ class BuilderWin(BuilderBase):
|
||||||
class BuilderLinux(BuilderBase):
|
class BuilderLinux(BuilderBase):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.name = 'teleport-server-linux-{}-{}'.format(ctx.bits_path, VER_TELEPORT_SERVER)
|
self.name = 'teleport-server-linux-{}-{}'.format(ctx.bits_path, VER_TP_WEB_SERVER)
|
||||||
self._final_file = os.path.join(env.root_path, 'out', 'installer', '{}.tar.gz'.format(self.name))
|
self._final_file = os.path.join(env.root_path, 'out', 'installer', '{}.tar.gz'.format(self.name))
|
||||||
|
|
||||||
self.dist_path = os.path.join(env.root_path, 'dist', 'server')
|
self.dist_path = os.path.join(env.root_path, 'dist', 'server')
|
||||||
|
|
|
@ -4,24 +4,21 @@
|
||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
from core import colorconsole as cc
|
from core import colorconsole as cc
|
||||||
from core import utils
|
|
||||||
from core.env import env
|
|
||||||
from core.context import *
|
from core.context import *
|
||||||
|
from core.env import env
|
||||||
|
|
||||||
ctx = BuildContext()
|
ctx = BuildContext()
|
||||||
|
|
||||||
|
|
||||||
# ROOT_PATH = utils.cfg.ROOT_PATH
|
|
||||||
|
|
||||||
|
|
||||||
class Builder:
|
class Builder:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ver_in = os.path.join(env.root_path, 'version.in')
|
self.ver_in = os.path.join(env.root_path, 'version.in')
|
||||||
|
|
||||||
self.VER_TELEPORT_SERVER = ''
|
self.VER_TP_SERVER = ''
|
||||||
self.VER_TELEPORT_ASSIST = ''
|
self.VER_TP_SRV_WWW = ''
|
||||||
self.VER_TELEPORT_ASSIST_REQUIRE = ''
|
self.VER_TP_SRV_TPCORE = ''
|
||||||
# self.VER_TELEPORT_MAKECERT = ''
|
self.VER_TP_SRV_TPWEB = ''
|
||||||
|
self.VER_TP_ASSIST = ''
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
cc.n('update version...')
|
cc.n('update version...')
|
||||||
|
@ -31,37 +28,39 @@ class Builder:
|
||||||
with codecs.open(self.ver_in, 'r', 'utf-8') as f:
|
with codecs.open(self.ver_in, 'r', 'utf-8') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for l in lines:
|
for l in lines:
|
||||||
if l.startswith('TELEPORT_SERVER '):
|
if l.startswith('TP_SERVER '):
|
||||||
x = l.split(' ')
|
x = l.split(' ')
|
||||||
self.VER_TELEPORT_SERVER = x[1].strip()
|
self.VER_TP_SERVER = x[1].strip()
|
||||||
elif l.startswith('TELEPORT_ASSIST '):
|
elif l.startswith('TP_SRV_WWW '):
|
||||||
x = l.split(' ')
|
x = l.split(' ')
|
||||||
self.VER_TELEPORT_ASSIST = x[1].strip()
|
self.VER_TP_SRV_WWW = x[1].strip()
|
||||||
elif l.startswith('TELEPORT_ASSIST_REQUIRE '):
|
elif l.startswith('TP_SRV_TPCORE '):
|
||||||
x = l.split(' ')
|
x = l.split(' ')
|
||||||
self.VER_TELEPORT_ASSIST_REQUIRE = x[1].strip()
|
self.VER_TP_SRV_TPCORE = x[1].strip()
|
||||||
# elif l.startswith('TELEPORT_MAKECERT '):
|
elif l.startswith('TP_SRV_TPWEB '):
|
||||||
# x = l.split(' ')
|
x = l.split(' ')
|
||||||
# self.VER_TELEPORT_MAKECERT = x[1].strip()
|
self.VER_TP_SRV_TPWEB = x[1].strip()
|
||||||
|
elif l.startswith('TP_ASSIST '):
|
||||||
|
x = l.split(' ')
|
||||||
|
self.VER_TP_ASSIST = x[1].strip()
|
||||||
|
|
||||||
#
|
|
||||||
cc.v('new version:')
|
cc.v('new version:')
|
||||||
cc.v(' TELEPORT-Server : ', self.VER_TELEPORT_SERVER)
|
cc.v(' Server : ', self.VER_TP_SERVER)
|
||||||
cc.v(' TELEPORT-Assist : ', self.VER_TELEPORT_ASSIST)
|
cc.v(' - WWW Server : ', self.VER_TP_SRV_WWW)
|
||||||
cc.v(' TELEPORT-Assist-require : ', self.VER_TELEPORT_ASSIST_REQUIRE)
|
cc.v(' - Core Server : ', self.VER_TP_SRV_TPCORE)
|
||||||
# cc.v(' TELEPORT-MakeCert : ', self.VER_TELEPORT_MAKECERT)
|
cc.v(' - Web Server : ', self.VER_TP_SRV_TPWEB)
|
||||||
|
cc.v(' Assist : ', self.VER_TP_ASSIST)
|
||||||
cc.v('')
|
cc.v('')
|
||||||
|
|
||||||
self.make_build_ver()
|
self.make_builder_ver()
|
||||||
|
self.make_srv_www_ver()
|
||||||
|
self.make_srv_tpcore_ver()
|
||||||
|
self.make_srv_tpweb_ver()
|
||||||
self.make_assist_ver()
|
self.make_assist_ver()
|
||||||
self.make_tp_core_ver()
|
|
||||||
self.make_tp_web_ver()
|
|
||||||
self.make_web_ver()
|
|
||||||
|
|
||||||
def make_build_ver(self):
|
def make_builder_ver(self):
|
||||||
ver_file = os.path.join(env.root_path, 'build', 'builder', 'core', 'ver.py')
|
ver_file = os.path.join(env.root_path, 'build', 'builder', 'core', 'ver.py')
|
||||||
# ver_content = '# -*- coding: utf8 -*-\nVER_TELEPORT_SERVER = "{}"\nVER_TELEPORT_ASSIST = "{}"\nVER_TELEPORT_MAKECERT = "{}"\n'.format(self.VER_TELEPORT_SERVER, self.VER_TELEPORT_ASSIST, self.VER_TELEPORT_MAKECERT)
|
ver_content = '# -*- coding: utf8 -*-\nVER_TP_SERVER = "{}"\nVER_TP_ASSIST = "{}"\n'.format(self.VER_TP_SERVER, self.VER_TP_ASSIST)
|
||||||
ver_content = '# -*- coding: utf8 -*-\nVER_TELEPORT_SERVER = "{}"\nVER_TELEPORT_ASSIST = "{}"\n'.format(self.VER_TELEPORT_SERVER, self.VER_TELEPORT_ASSIST)
|
|
||||||
|
|
||||||
rewrite = False
|
rewrite = False
|
||||||
if not os.path.exists(ver_file):
|
if not os.path.exists(ver_file):
|
||||||
|
@ -78,60 +77,14 @@ class Builder:
|
||||||
with open(ver_file, 'w') as f:
|
with open(ver_file, 'w') as f:
|
||||||
f.write(ver_content)
|
f.write(ver_content)
|
||||||
|
|
||||||
def make_web_ver(self):
|
def make_srv_tpcore_ver(self):
|
||||||
ver_file = os.path.join(env.root_path, 'server', 'www', 'teleport', 'app', 'eom_ver.py')
|
|
||||||
# ver_content = '# -*- coding: utf8 -*-\n\nTS_VER = "{}"\n'.format(self.VER_TELEPORT_SERVER)
|
|
||||||
ver_content = '# -*- coding: utf8 -*-\nTS_VER = "{}"\nTP_ASSIST_LAST_VER = "{}"\nTP_ASSIST_REQUIRE = "{}"\n'.format(self.VER_TELEPORT_SERVER, self.VER_TELEPORT_ASSIST, self.VER_TELEPORT_ASSIST_REQUIRE)
|
|
||||||
|
|
||||||
rewrite = False
|
|
||||||
if not os.path.exists(ver_file):
|
|
||||||
rewrite = True
|
|
||||||
else:
|
|
||||||
old_content = ''
|
|
||||||
with open(ver_file, 'r') as f:
|
|
||||||
old_content = f.read()
|
|
||||||
if old_content != ver_content:
|
|
||||||
rewrite = True
|
|
||||||
|
|
||||||
if rewrite:
|
|
||||||
cc.v(' update {}...'.format(ver_file))
|
|
||||||
with open(ver_file, 'w') as f:
|
|
||||||
f.write(ver_content)
|
|
||||||
|
|
||||||
def make_assist_ver(self):
|
|
||||||
ver_file = os.path.join(env.root_path, 'client', 'tp_assist', 'ts_ver.h')
|
|
||||||
ver_content = '#ifndef __TS_ASSIST_VER_H__\n#define __TS_ASSIST_VER_H__\n\n#define TP_ASSIST_VER\tL"{}"\n\n#endif // __TS_ASSIST_VER_H__\n'.format(self.VER_TELEPORT_ASSIST)
|
|
||||||
|
|
||||||
rewrite = False
|
|
||||||
if not os.path.exists(ver_file):
|
|
||||||
rewrite = True
|
|
||||||
else:
|
|
||||||
old_content = ''
|
|
||||||
with open(ver_file, 'r') as f:
|
|
||||||
old_content = f.read()
|
|
||||||
if old_content != ver_content:
|
|
||||||
rewrite = True
|
|
||||||
|
|
||||||
if rewrite:
|
|
||||||
cc.v(' update {}...'.format(ver_file))
|
|
||||||
with open(ver_file, 'w') as f:
|
|
||||||
f.write(ver_content)
|
|
||||||
|
|
||||||
rc_file = os.path.join(env.root_path, 'client', 'tp_assist', 'tp_assist.rc')
|
|
||||||
self._update_vs_rc(rc_file, self.VER_TELEPORT_ASSIST)
|
|
||||||
|
|
||||||
nsi_file = os.path.join(env.root_path, 'dist', 'client', 'windows', 'assist', 'installer.nsi')
|
|
||||||
self._update_nsi_rc(nsi_file, self.VER_TELEPORT_ASSIST)
|
|
||||||
|
|
||||||
def make_tp_core_ver(self):
|
|
||||||
ver_file = os.path.join(env.root_path, 'server', 'tp_core', 'core', 'ts_ver.h')
|
ver_file = os.path.join(env.root_path, 'server', 'tp_core', 'core', 'ts_ver.h')
|
||||||
ver_content = '#ifndef __TS_SERVER_VER_H__\n#define __TS_SERVER_VER_H__\n\n#define TP_SERVER_VER\tL"{}"\n\n#endif // __TS_SERVER_VER_H__\n'.format(self.VER_TELEPORT_SERVER)
|
ver_content = '#ifndef __TS_SERVER_VER_H__\n#define __TS_SERVER_VER_H__\n\n#define TP_SERVER_VER\tL"{}"\n\n#endif // __TS_SERVER_VER_H__\n'.format(self.VER_TP_SRV_TPCORE)
|
||||||
|
|
||||||
rewrite = False
|
rewrite = False
|
||||||
if not os.path.exists(ver_file):
|
if not os.path.exists(ver_file):
|
||||||
rewrite = True
|
rewrite = True
|
||||||
else:
|
else:
|
||||||
old_content = ''
|
|
||||||
with open(ver_file, 'r') as f:
|
with open(ver_file, 'r') as f:
|
||||||
old_content = f.read()
|
old_content = f.read()
|
||||||
if old_content != ver_content:
|
if old_content != ver_content:
|
||||||
|
@ -143,11 +96,30 @@ class Builder:
|
||||||
f.write(ver_content)
|
f.write(ver_content)
|
||||||
|
|
||||||
rc_file = os.path.join(env.root_path, 'server', 'tp_core', 'core', 'tp_core.rc')
|
rc_file = os.path.join(env.root_path, 'server', 'tp_core', 'core', 'tp_core.rc')
|
||||||
self._update_vs_rc(rc_file, self.VER_TELEPORT_SERVER)
|
self._update_vs_rc(rc_file, self.VER_TP_SRV_TPCORE)
|
||||||
|
|
||||||
def make_tp_web_ver(self):
|
def make_srv_www_ver(self):
|
||||||
ver_file = os.path.join(env.root_path, 'server', 'tp_web', 'src', 'ts_ver.h')
|
ver_file = os.path.join(env.root_path, 'server', 'www', 'teleport', 'webroot', 'app', 'app_ver.py')
|
||||||
ver_content = '#ifndef __TS_SERVER_VER_H__\n#define __TS_SERVER_VER_H__\n\n#define TP_SERVER_VER\tL"{}"\n\n#endif // __TS_SERVER_VER_H__\n'.format(self.VER_TELEPORT_SERVER)
|
# ver_content = '# -*- coding: utf8 -*-\n\nTS_VER = "{}"\n'.format(self.VER_TELEPORT_SERVER)
|
||||||
|
ver_content = '# -*- coding: utf8 -*-\nTP_SRV_WWW_VER = "{}"\n'.format(self.VER_TP_SRV_WWW)
|
||||||
|
|
||||||
|
rewrite = False
|
||||||
|
if not os.path.exists(ver_file):
|
||||||
|
rewrite = True
|
||||||
|
else:
|
||||||
|
with open(ver_file, 'r') as f:
|
||||||
|
old_content = f.read()
|
||||||
|
if old_content != ver_content:
|
||||||
|
rewrite = True
|
||||||
|
|
||||||
|
if rewrite:
|
||||||
|
cc.v(' update {}...'.format(ver_file))
|
||||||
|
with open(ver_file, 'w') as f:
|
||||||
|
f.write(ver_content)
|
||||||
|
|
||||||
|
def make_assist_ver(self):
|
||||||
|
ver_file = os.path.join(env.root_path, 'client', 'tp_assist_win', 'ts_ver.h')
|
||||||
|
ver_content = '#ifndef __TS_ASSIST_VER_H__\n#define __TS_ASSIST_VER_H__\n\n#define TP_ASSIST_VER\tL"{}"\n\n#endif // __TS_ASSIST_VER_H__\n'.format(self.VER_TP_ASSIST)
|
||||||
|
|
||||||
rewrite = False
|
rewrite = False
|
||||||
if not os.path.exists(ver_file):
|
if not os.path.exists(ver_file):
|
||||||
|
@ -164,8 +136,32 @@ class Builder:
|
||||||
with open(ver_file, 'w') as f:
|
with open(ver_file, 'w') as f:
|
||||||
f.write(ver_content)
|
f.write(ver_content)
|
||||||
|
|
||||||
|
rc_file = os.path.join(env.root_path, 'client', 'tp_assist_win', 'tp_assist.rc')
|
||||||
|
self._update_vs_rc(rc_file, self.VER_TP_ASSIST)
|
||||||
|
|
||||||
|
nsi_file = os.path.join(env.root_path, 'dist', 'client', 'windows', 'assist', 'installer.nsi')
|
||||||
|
self._update_nsi_rc(nsi_file, self.VER_TP_ASSIST)
|
||||||
|
|
||||||
|
def make_srv_tpweb_ver(self):
|
||||||
|
ver_file = os.path.join(env.root_path, 'server', 'tp_web', 'src', 'ts_ver.h')
|
||||||
|
ver_content = '#ifndef __TS_SERVER_VER_H__\n#define __TS_SERVER_VER_H__\n\n#define TP_SERVER_VER\tL"{}"\n\n#endif // __TS_SERVER_VER_H__\n'.format(self.VER_TP_SRV_TPWEB)
|
||||||
|
|
||||||
|
rewrite = False
|
||||||
|
if not os.path.exists(ver_file):
|
||||||
|
rewrite = True
|
||||||
|
else:
|
||||||
|
with open(ver_file, 'r') as f:
|
||||||
|
old_content = f.read()
|
||||||
|
if old_content != ver_content:
|
||||||
|
rewrite = True
|
||||||
|
|
||||||
|
if rewrite:
|
||||||
|
cc.v(' update {}...'.format(ver_file))
|
||||||
|
with open(ver_file, 'w') as f:
|
||||||
|
f.write(ver_content)
|
||||||
|
|
||||||
rc_file = os.path.join(env.root_path, 'server', 'tp_web', 'src', 'tp_web.rc')
|
rc_file = os.path.join(env.root_path, 'server', 'tp_web', 'src', 'tp_web.rc')
|
||||||
self._update_vs_rc(rc_file, self.VER_TELEPORT_SERVER)
|
self._update_vs_rc(rc_file, self.VER_TP_SRV_TPWEB)
|
||||||
|
|
||||||
def _update_vs_rc(self, rcFilePath, ver):
|
def _update_vs_rc(self, rcFilePath, ver):
|
||||||
""" update rc file version info """
|
""" update rc file version info """
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
VER_TELEPORT_SERVER = "2.2.10.1"
|
VER_TP_SERVER = "3.0.0.1"
|
||||||
VER_TELEPORT_ASSIST = "2.2.6.1"
|
VER_TP_ASSIST = "3.0.0.1"
|
||||||
|
|
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
#ifndef __TS_ASSIST_VER_H__
|
#ifndef __TS_ASSIST_VER_H__
|
||||||
#define __TS_ASSIST_VER_H__
|
#define __TS_ASSIST_VER_H__
|
||||||
|
|
||||||
#define TP_ASSIST_VER L"2.2.6.1"
|
#define TP_ASSIST_VER L"3.0.0.1"
|
||||||
|
|
||||||
#endif // __TS_ASSIST_VER_H__
|
#endif // __TS_ASSIST_VER_H__
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
#ifndef __TS_SERVER_VER_H__
|
#ifndef __TS_SERVER_VER_H__
|
||||||
#define __TS_SERVER_VER_H__
|
#define __TS_SERVER_VER_H__
|
||||||
|
|
||||||
#define TP_SERVER_VER L"2.2.10.1"
|
#define TP_SERVER_VER L"3.0.0.1"
|
||||||
|
|
||||||
#endif // __TS_SERVER_VER_H__
|
#endif // __TS_SERVER_VER_H__
|
||||||
|
|
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
#ifndef __TS_SERVER_VER_H__
|
#ifndef __TS_SERVER_VER_H__
|
||||||
#define __TS_SERVER_VER_H__
|
#define __TS_SERVER_VER_H__
|
||||||
|
|
||||||
#define TP_SERVER_VER L"2.2.10.1"
|
#define TP_SERVER_VER L"3.0.0.1"
|
||||||
|
|
||||||
#endif // __TS_SERVER_VER_H__
|
#endif // __TS_SERVER_VER_H__
|
||||||
|
|
|
@ -1,4 +1,2 @@
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
TP_SERVER_VER = "2.2.10.1"
|
TP_SRV_WWW_VER = "3.0.0.1"
|
||||||
TP_ASSIST_LAST_VER = "2.2.6.1"
|
|
||||||
TP_ASSIST_REQUIRE = "2.0.0.1"
|
|
||||||
|
|
15
version.in
15
version.in
|
@ -1,19 +1,20 @@
|
||||||
版本号说明:Major.Minor.Revision.Build
|
版本号说明:Major.Minor.Revision.Build
|
||||||
例如:2.12.1027.7
|
例如:2.12.1027.7
|
||||||
|
|
||||||
Major : 主版本号。具有相同名称但不同主版本号的程序集不可互换。
|
Major : 主版本号。不同主版本号的程序集不可互换。
|
||||||
例如,这适用于对产品的大量重写,这些重写使得无法实现向后兼容性。
|
例如,这适用于对产品的大量重写,这些重写使得无法实现向后兼容性。
|
||||||
|
|
||||||
Minor : 次版本号。如果两个程序集的名称和主版本号相同,而次版本号不同,这指示显著增强,但照顾到了向后兼容性。
|
Minor : 次版本号。如果两个程序集的名称和主版本号相同,而次版本号不同,这指示显著增强,但照顾到了向后兼容性。
|
||||||
例如,这适用于产品的修正版或完全向后兼容的新版本。
|
例如,这适用于产品的修正版或完全向后兼容的新版本,但不保证可以降级使用。
|
||||||
|
|
||||||
Revision : 修订号。名称、主版本号和次版本号都相同但修订号不同的程序集应是完全可互换的。
|
Revision : 修订号。主版本号和次版本号都相同但修订号不同的程序集应是完全可互换的。
|
||||||
这适用于修复以前发布的程序集中的错误或安全漏洞。修订号总是递增的,是唯一的。
|
这适用于修复以前发布的程序集中的错误或安全漏洞。修订号总是递增的,是唯一的。
|
||||||
|
|
||||||
Build : 构建号。构建号用于表明此版本发布之前进行了多少次构建及测试。某些情况下此版本号可以省略。
|
Build : 构建号。构建号用于表明此版本发布之前进行了多少次构建及测试。某些情况下此版本号可以省略。
|
||||||
|
|
||||||
|
|
||||||
|
TP_SERVER 3.0.0.1 # 整个服务端打包的版本,任意一个 TP_SRV_xxx 升级,此版本也需要升级
|
||||||
TELEPORT_SERVER 2.2.10.1
|
TP_SRV_WWW 3.0.0.1 # web前后端版本
|
||||||
TELEPORT_ASSIST 2.2.6.1
|
TP_SRV_TPCORE 3.0.0.1 # 核心服务 tp_core 的版本
|
||||||
TELEPORT_ASSIST_REQUIRE 2.0.0.1
|
TP_SRV_TPWEB 3.0.0.1 # web服务 tp_web 的版本(一般除非升级Python,否则不会变化)
|
||||||
|
TP_ASSIST 3.0.0.1 # 助手版本
|
||||||
|
|
Loading…
Reference in New Issue