将ci结果部署到git

cico的Python项目详细描述


西科

Build StatusPyPILicense

将CI结果部署到Git

cico将ci环境生成的人工制品提交给git结果分支。

对于每个测试的分支,将在结果分支中创建一个目录。

  • tested branch:您提交的分支已由CI工具签出
  • results branch:应该部署结果的分支
    • 可以位于与测试分支不同的存储库中

安装

$ pip install cico

用法

deploy.py

fromcicoimportTravisCIfromcico.resultsimportDirectory,File,BadgeTravisCI(repo=GitHub(USERNAME,# GitHub Username (e.g. 'stefanhoelzl')REPO_NAME,# GitHub Repository (e.g. 'ci-results')TOKEN),# GitHub Personal access tokens# ONLY ENCRYPTED (https://docs.travis-ci.com/user/environment-variables/#Defining-encrypted-variables-in-.travis.yml)branch=RESULT_BRANCH,# Git Branch with the results (e.g. 'cico-testing')results=[# Deploy file 'testresults.tap' into folder 'tap' (destination is optional)File("testresults.tap",destination="tap"),# Deploy file 'wrong_name.tap' as 'correct_name.tap' (rename is optional)File("wrong_name.txt",rename="correct_name.txt"),# Deploy directory 'covhtml' into folder 'coverage' (desitnation is optional)Directory("covhtml",destination="coverage"),# Create a Badge with the label "My Badge" and value "96" as mybadge.svg and mybadge.png# (png is optional) in the directory 'badges'Badge("badges/mybadge",png=True,label="My Badge",value=96,**anybadge_arguments),# https://github.com/jongracecox/anybadge]).commit(# commit message (optional)# {build} gets replaced by build number# {branch} gets replaced by name of tested branchmessage="build {build} on branch {branch}",# perform 'git push' even if not executed in CI environment (default=False)no_ci_push=True)

.travis.yml带有after_script部分

after_script:-python deploy.py

.travis.yml带有deploy部分

deploy:provider:scriptskip_cleanup:true# prevent TravisCI from cleaning up the files you want to deployscript:python deploy.py

存储库分支cico-testing中的目录结构ci-results

+-- master
    o-- correct_name.txt
    +-- tap
    |   o-- testresults.tap
    +-- covhtml
    |   +-- <all contents of covhtml in the tested branch>
    +-- badges
        o-- mybadge.svg
        o-- mybadge.png

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java系统。出来打印导致延迟?   java如何使用dasein API连接Azure云(blob存储)   java如何将Jframe cardlayout中的“card”从属于card的Jpanel更改为另一个类?   java如何在单个消息框中显示循环的所有迭代?   java如何设置netbeans保存项目的操作?   java网站的某些选项在web视图中不起作用   java如何在安卓中打开从右到左的菜单滑动条   java更容易反转由静态方法(函数接口)内联创建的比较器?   映射Java HashMap。获取(键)和树形图。获取equals和compareTo方法的(键)用法   java Health endpoints只显示“status:up”,不显示敏感信息   java当我一直按back按钮登录时,字段显示以前插入的用户数据   JTable单元中的java图像显示   go Java vs.Golang for HOTP(rfc4226)   java使用函数链减少分支和清理代码,这有意义吗   java我应该为每个查询创建一个新的DB连接吗?   java推荐的函数调用方法(是否使用CompiledScript?)   java截断分区和地板分区有什么区别?   没有spring引导的java Profile特定属性文件?   异常如何在java中从控制台读取密码?