在RPM规范文件中使用Jenkins BUILD NUMBER [英] Using Jenkins BUILD NUMBER in RPM spec file

查看:159
本文介绍了在RPM规范文件中使用Jenkins BUILD NUMBER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Name:                   My Software
Version:                1.0.5
Release:                1
Summary:                This is my software

不确定是否有人曾经尝试过此方法或它是否简单,但是:

Not sure if anyone has tried this before or if it is easy, but:

规范文件的版本具有两个唯一的指示符:

A spec file has two unique indicators for its version:

  • 版本(指定软件版本)
  • 发布(指定软件包的编号-如果构建RPM,则损坏,再构建另一个,则增加发布"编号.

我想知道是否有人尝试过,或者知道如何使用Jenkins $ BUILD_NUMBER变量来动态更改Release编号,从而在每次新的成功构建完成时增加Release编号... ?

I'm wondering if anyone has tried, or knows how, I could use the Jenkins $BUILD_NUMBER variable to dynamically change the Release number, thereby increasing the Release number every time a new successful build completes...?

推荐答案

已经很长时间了...幸好我没有基于rpm的系统,所以我无法对其进行测试.

It's been a long time... and thankfully I have no rpm based systems so I can't test this.

您可以在命令行上将参数传递给rpmbuild

You can pass parameters to rpmbuild on the commandline

rpmbuild --define="version ${env.BUILD_NUMBER}"

发布规范的片段和用于构建rpm的脚本会很有帮助. 您不希望您的构建脚本编辑规范文件,我假设它是从某些源代码管理中拉出来的.

It would be helpful to post snippets of the spec and the script you're using to build the rpm. You don't want your build script editing the spec file, which I'm assuming it's pulling out down from some source control.

这篇关于在RPM规范文件中使用Jenkins BUILD NUMBER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆