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 = [ ],  
                      )) 
  • 相关阅读:
    vue-cli脚手架工具构建&初始化vue项目
    2020/05/17 Github加速-DNS配置
    同时将本地git仓库提交到gitee和github
    git远程仓库在本地看不到&push 到远程仓库失败的解决方案
    stylus的使用-变量和函数
    webpack使用4-HRM热替换&SourceMap&解析es语法
    webpack使用3-plugin插件的使用
    webpack使用2-常用的几个loader的使用
    webpack基本使用
    spring框架里面的注入?
  • 原文地址:https://www.cnblogs.com/morya/p/4535171.html
Copyright © 2011-2022 走看看