示例#1
0
def copy_compile_file(server_deploy_list):
    for deploy_info in server_deploy_list:
        cmd = [
            'robocopy', deploy_info['Sources'], deploy_info['Destination'],
            '/e'
        ]
        # 过滤忽略文件夹
        ignore_folders = deploy_info['IgnoreFile']['Folder']
        if ignore_folders is not None:
            filter_folder_cmd = ['/xd']
            filter_folder_cmd.extend(ignore_folders)
            cmd.extend(filter_folder_cmd)

        # 过滤掉忽略文件,对pdb文件进行单独处理
        ignore_files = deploy_info['IgnoreFile']['File']
        if ignore_files is not None:
            ignore_files[ignore_files.index('.pdb')] = '*.pdb'
            filter_file_cmd = ['/xf']
            filter_file_cmd.extend(ignore_files)
            cmd.extend(ignore_files)

        # 执行命令
        process = command_execute(cmd)
        for line in process.stdout:
            print(line, end='')
示例#2
0
def kill_service_process(ip, process_exec):
    cmd = [
        'taskkill', '/S', ip, '/U', 'administrator', '/P', 'zhuopin', '/IM',
        process_exec
    ]
    process = command_execute(cmd)
    for line in process.stdout:
        print(line, end='')
示例#3
0
def pull_code_task(pull_code_param):
    cmd = [
        pull_code_param['TFPath'], 'get', pull_code_param['SolutionPath'],
        pull_code_param['WorkSpace'],
        '/login:{},{}'.format(pull_code_param['UserName'],
                              pull_code_param['PassWord'])
    ]
    process = command_execute(cmd)
    for line in process.stdout:
        print(line, end='')
示例#4
0
def connect_server(server_info):
    cmd = [
        'net',
        'use',
        '\\\\{}\ipc$'.format(server_info['IP']),
        server_info['PassWord'],
        '/user:{}'.format(server_info['UserName']),
    ]
    process = command_execute(cmd)
    for line in process.stdout:
        print(line, end='')
示例#5
0
def compile_task(compile_sln_param):
    cmd = [
        compile_sln_param['MSBuildPath'],
        '{}\\{}\\{}.sln'.format(compile_sln_param['WorkSpace'],
                                compile_sln_param['SolutionName'],
                                compile_sln_param['SolutionName']),
        '/t:Rebuild', '/p:Configuration=Debug', '/p:VisualStudioVersion=14.0'
    ]
    process = command_execute(cmd)
    for line in process.stdout:
        print(line, end='')
示例#6
0
def disconnect_server(server_info):
    cmd = ['net', 'use', '\\\\{}'.format(server_info['IP']), '/delete', '/y']
    process = command_execute(cmd)
    for line in process.stdout:
        print(line, end='')
示例#7
0
def stop_service(ip, service_name):
    cmd = ['sc', '\\\\{}'.format(ip), 'stop', service_name]
    process = command_execute(cmd)
    for line in process.stdout:
        print(line, end='')