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 = [ ],  
                      )) 
  • 相关阅读:
    1203—颜文生—自动机实验
    11-11 优点缺点评价
    操作系统之银行家算法避免死锁
    操作系统之实验三 进程调度模拟程序
    操作系统之实验二作业调度模拟程序
    操作系统之实验二Step1-有序顺序表
    复利计算程序的单元测试
    操作系统之实验一 命令解释程序的编写
    复利计算程序之最新版
    《构建之法》第1.2.3章的感悟
  • 原文地址:https://www.cnblogs.com/morya/p/4535171.html
Copyright © 2011-2022 走看看