• buildbot的codebaseGenerator


    buildbot的codebaseGenerator文档非常简单,简单到令人发指。

    也没有一个例子,唉,辛苦了好几个小时才研究清楚怎么设置。

    赶紧记录下吧,不然下次又要纠结。

    应用场景:web status页面里面的 ForceScheduler使用codebases参数指定多个codebase,在页面Force启动时,可以动态对一个repository指定branch,URL等信息,
    方便自定义。



    首先,文档说了:
    For any incoming change, the codebase is set to ''. This codebase value is sufficient if all changes come from the same repository (or clones). If changes come from different repositories, extra processing will be needed to determine the codebase for the incoming change. This codebase will then be a logical name for the combination of repository and or branch etc.
    The codebaseGenerator accepts a change dictionary as produced by thebuildbot.db.changes.ChangesConnectorComponent, with a changeid equal to None.


    配置主要涉及三个地方:
    - 全局字典需要设置 'codebaseGenerator' 参数。
    - ForceScheduler需要通过参数codebases指定相关的repository。
    - source checkout step 需要通过codebase参数指定确定的repos。
    关键配置代码如下:

    REPOS1_URL = 'git@192.168.7.1:repos1.git'
    
    REPOS2_URL = 'git@192.168.7.1:repos2.git'
    
    all_repositories = {
    REPOS1_URL : 'repos1',
    REPOS2_URL : 'repos2',
    }
    
    
    def codebaseGenerator(chdict):
    return constants.all_repositories[chdict['repository']]
    
    
    c['codebaseGenerator'] = codebaseGenerator
    
    
    all_code_bases = [ 
        CodebaseParameter(codebase = 'repos1'),
        CodebaseParameter(codebase = 'repos2'),
    ]
    
    _schedulers.append(ForceScheduler(
                      name="manual_start_im_build",
                      builderNames=["builder"],
                      buttonName = "Do the magic",
                      codebases = all_code_bases,
                      properties = [ ],  
                      )) 
  • 相关阅读:
    POJ 1811 大整数素数判断 Miller_Rabin
    hdu 4940 无源汇有上下界最大流
    hdu 4975 最大流解决行列和求矩阵问题,用到矩阵dp优化
    hdu 4971 多校10最大权闭合图
    hdu 4888 最大流给出行列和求矩阵
    poj 3621最优比例生成环(01分数规划问题)
    poj 2728 最优比例生成树(01分数规划)模板
    最优比例生成树最优比率生成树 01分数规划问题
    poj 2553强连通+缩点
    poj 2831 次小生成树模板
  • 原文地址:https://www.cnblogs.com/morya/p/4535171.html
Copyright © 2020-2023  润新知