zoukankan      html  css  js  c++  java
  • 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 = [ ],  
                      )) 
  • 相关阅读:
    [知识点]计算几何I——基础知识与多边形面积
    [旧版][知识点]SPFA算法
    [旧版][知识点]A*搜索(启发式搜索)
    [知识点]线段树
    [小工具]ChemistryHelper
    [考试]20150314
    [知识点]Cantor展开
    [旧版][知识点]拓扑排序
    [无效]网络流之Dinic算法
    [SCOI2005]扫雷Mine
  • 原文地址:https://www.cnblogs.com/morya/p/4535171.html
Copyright © 2011-2022 走看看