基于Jenkins和Koji的代码管理及构建系统

Summary

Currently, we KVM team are maintaining the code repository of the virtualization software(such as QEMU, Libvirt, Kimchi, Linux, etc.) for PowerKVM development team and delivering corresponding RPM packages. We collect patches from mailing list and build update RPM packages every workday. The work load is extremely heavy if we manually download the patches from mailing list, apply them to the repository, and build RPM packages covering all the supported platforms.

This environment, based on Jenkins and Koji, can automatically manage the code(apply the patches from mailing lists to the appropriate repository and branch) and build the required RPM packages covering all supported platforms nightly or triggered manually. By using this automation environment, developers can easily get the updated RPM packages just by sending the patches to the given e-mail address or mailing list. Furthermore, the time cost for daily routine work is dramatically reduced and the quality of the packages will be improved by eliminating human errors. This environment also can be used to other projects by making few changes to configure files.

Challenges

In PowerKVM development, we have to ship all the significant bug fixes frequently, usually a couple days. All the fix patches of QEMU, Libvirt, Linux, Kimchi will be sent to a certain mailing list. After the code cut-off day, we download all the patches from the mailing list and manually apply them to different git repositories accordingly. Then copy all the git repositories to different platform(RHEL,Fedora,etc) and do build. Last step, copy all the output RPM packages to different RPM repositories accordingly. Sometimes, we can not deliver the packages on time because the workload is extremely heavy. Furthermore, errors occur frequently such as some patches may get lost during the process due to lack of time. In order to solve these problems, we decided to make use of Jenkins and Koji to establish the CI environment.

During the construction of this environment, we have to resolve the following problems:

  • Define the rules of sending patches for developers in order to make the CI know where the patches should go.
  • Define the regular expression to distinguish patches from other e-mails.
  • How to handle exceptions.

Experience

<1>. Tools and Framework Overview

In order to implement this automation environment, several tools are needed:

  • Jenkins: Jenkins is a software that monitors executions of repeated jobs. This automation environment use Jenkins as the user interface and the manager of all the underlying jobs.
  • Koji: Koji can build RPMs packages for multiple platforms. This automation environment make use of Koji to build RPMs for all supported platform.
  • Python scripts: implement the function that collect patches from mailing list, organize and archive these patches.
  • Shell scripts: Apply the patches to the appropriate git repositories, process build and release the output RPM packages via web server.
  • Apache HTTP server: Release the RPMs via web page.
    Below is the chart about the framework overview of this automation environment and the relationship among these tools.

<2>. User Interface

The automation environment runs nightly. However, if the developer want to get the RPM packages immediately, he or she can simply click the start button of Jenkins. See below chart.

<3>. Execution flow

After the developers click the first run button, jenkins will call python scripts to collect emails matching certain regular expression(We advise developers send patches to mailing list in fixed forms, such as [branch_name PATCH repo_name]xxx) and archive all the patches by date. Then, Jenkins will call shell scripts to apply these patches to the appropriate git repositories. After that, Koji will be noticed to build the RPM packages of all the supported platforms. Finally, Jenkins will call the shell scripts to copy all the RPM packages to certain directory of Apache web server.

<4>. Handle exception

The automation environment will send report containing how many patches received and where the RPM packages are published to the mailing list if all the jobs are successfully executed. If a certain job failed, it also sends report to the mailing list or email boxes configured in the configuration file. Different job has different error report message. For example, when the job who collects patches from mailing list fails, it will send out the failed patches‘ name, but when the job who builds RPM packages fails, it will send out the build log.

Benefit

For the repositories maintainers, this automation environment can save much time costs for their daily routing work. What they need to do is just check reports via email clients if this automation environment start to work. The time costs dramatically reduce from several hours to a few minutes.

For the developers, they can get the RPM packages by themselves whenever they want to build one, instead of asking the maintainers spend much time to build for them. What they need to do is simply click a button.

Furthermore, the quality of the RPM packages will be improved because this automation environment can eliminate human errors effectively.

Next Steps and Recommendations

Currently, this automation environment is just used for code management and RPM packages build. Since it can save much time cost for developers and repository maintainers, we are planing to involve test cases. We can make use of automation test technology and integrate the test cases into this automation environment. After that, test engineers will be set free from burdensome test work.

时间: 2024-08-08 06:51:50

基于Jenkins和Koji的代码管理及构建系统的相关文章

基于Jenkins + Ant + Tomcat 的安卓客户端可持续化构建及发布下载

一. Jenkins 可持续化构建环境请参考 文章 http://my.oschina.net/long0419/blog/183299 二. 基于搭好可持续构建环境完成基础上 ,使用Ant 来编写安卓持续化构建环境 (未使用gradle 原理一样) 1.首先要去官网下载ANT代码. ANT官网下载地址 2.下载ANT循环打包JAR包. ANT循环JAR包下载地址 网盘下载地址 3.解压得到其中的ant-contrib-1.0b3.jar文件待用. 做完以上3步,ANT多渠道打包所需要的软件就准

Jenkins代码管理

1.1  Jenkins安装与下载应用代码 应用部署 http://jenkins-ci.org http://wordpress.org/ http://core.svn.wordpress.org/tags/ jenkins为分发服务器 [[email protected] ~]# wget http://pkg.jenkins-ci.org/redhat-stable/jenkins-2.7.2-1.1.noarch.rpm http://pkg.jenkins-ci.org/redhat

基于 Jenkins 快速搭建持续集成环境

持续集成是一种软件开发实践,对于提高软件开发效率并保障软件开发质量提供了理论基础.Jenkins 是一个开源软件项目,旨在提供一个开放易用的软件平台,使持续集成变成可能.本文正是从持续集成的基本概念入手,通过具体实例,介绍了如何基于 Jenkins 快速搭建持续集成环境. 持续集成概述 什么是持续集成 随着软件开发复杂度的不断提高,团队开发成员间如何更好地协同工作以确保软件开发的质量已经慢慢成为开发过程中不可回避的问题.尤其是近些年来,敏捷(Agile) 在软件工程领域越来越红火,如何能再不断变

基于Jenkins的自动构建系统开发_android总结

持续集成相关理论 1.1 极限编程的概述 1.1.1 极限编程的产生 2001年,为了解决许多公司的软件团队陷入不断增长的过程泥潭,一批业界专家一起概括出了一些可以让软件开发团队具有快速工作.响应变化能力的价值观和原则,他们称自己为敏捷联盟.敏捷开发过程的方法很多,主要有:SCRUM,Crystal,特征驱动软件开发(Feature Driven Development,简称FDD),自适应软件开发(Adaptive Software Development,简称ASD),以及最重要的极限编程(

基于Jenkins+git+gradle的android持续集成,jenkinsgradle

转载:http://www.android100.org/html/201506/22/156680.html 基于Jenkins+git+gradle的android持续集成,jenkinsgradle 本文参考了: http://my.oschina.net/uboluo/blog/157483 http://java.dzone.com/articles/automating-continuous 以前都是通过IDE(eclipse or Android Studio)手动生成apk通过Q

基于jenkins搭建一个持续集成服务器

1 引言 1.1 编写目的 指导质量管理部,业务测试组同事进行Jenkins环境部署,通过Jenkins解决测试环境不可控,开发测试环境不一致等问题. 1.2 使用对象 质量管理部.基础研发部,集成部署部及EMT 目标受众: 本文的预期受众是从事持续交付或持续自动测试工作的软件工程师.要想按照本文中的步骤进行操作,您应该理解: 脚本开发. 软件开发流程. 1.3 持续集成概述 1.3.1 什么是持续集成 随着软件开发复杂度的不断提高,团队开发成员间如何更好地协同工作以确保软件开发的质量已经慢慢成

基于Jenkins持续集成CI

持续集成强调开发人员提交了新代码之后,立刻进行构建.(单元)测试.根据测试结果,我们可以确定新代码和原有代码能否正确地集成在一起. 持续交付在持续集成的基础上,将集成后的代码部署到更贴近真实运行环境的「类生产环境」(production-like environments)中.比如,我们完成单元测试后,可以把代码部署到连接数据库的 Staging 环境中更多的测试.如果代码没有问题,可以继续手动部署到生产环境中 持续部署则是在持续交付的基础上,把部署到生产环境的过程自动化. 集成:是指软件个人研

基于Jenkins,docker实现自动化部署(持续交付)

前言 随着业务的增长,需求也开始增多,每个需求的大小,开发周期,发布时间都不一致.基于微服务的系统架构,功能的叠加,对应的服务的数量也在增加,大小功能的快速迭代,更加要求部署的快速化,智能化.因此,传统的人工部署已经心有余而力不足.持续集成,持续部署,持续交互对于微服务开发来说,是提高团队整体效率不可或缺的一环.合理的使用CI,CD能够极大的提高了生产效率,也提高了产品的交互质量.本文不对三个概念做过多的介绍,有兴趣可以读读这篇文章:The Product Managers' Guide to

基于 Jenkins+Docker+Git 的CI流程初探

在如今的互联网时代,随着软件开发复杂度的不断提高,软件开发和发布管理也越来越重要.目前已经形成一套标准的流程,最重要的组成部分就是持续集成(Continuous Integration,CI)及持续部署.交付(CD).在此,我们来以一个案例初步了解 CI 流程.那么什么是 CI 呢?简单来讲,CI 就是将传统的代码合并.构建.部署.测试都集成在一起,不断地执行这个过程,并对结果进行反馈. CI 流程设计图: 工作流程: 1. 开发人员提交代码到Git版本仓库:2. Jenkins人工/定时触发项