简体   繁体   English

希望在每次CVS更改时在Jenkins中拥有一个新版本,但每两天不超过一个版本

[英]Want to have a new build in Jenkins at every CVS changes, but not more than one build every two days

how to schedule to meet this requirement? 如何安排满足此要求?

  1. If there is a previous build in last two days, and comes a change in CVS, then the next build will be started two days later from the previous build 如果最近两天内有一个先前的版本,并且CVS发生了变化,那么下一个版本将在上一个版本的两天后开始
  2. If there comes a change in CVS, and the previous build finished before two days ago, start this build immediately. 如果CVS发生变化,并且前两天前完成了先前的构建,请立即开始此构建。

Your need requires a custom, "smart" trigger for the build. 您的需求需要一个自定义的“智能”触发器进行构建。

I have a similar need, and I use the Jenkins ScriptTrigger plugin to execute a "smart" shell script that will evaluate the conditions and decide if to start a build or not. 我也有类似的需求,并且我使用Jenkins ScriptTrigger插件执行“智能” shell脚本,该脚本将评估条件并决定是否开始构建。

Example logic in script: 脚本中的示例逻辑:

  1. Check if two days have passed from last build 检查上次构建是否已经过了两天
  2. If so, check if there was also a change in VCS compared to last build 如果是这样,请检查与上一个版本相比,VCS是否也有变化
  3. If so, exit 0, and allow build to start 如果是这样,请退出0,并允许构建开始

I hope this helps. 我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 詹金斯 - 这可能吗? 为基于参数的作业提供多个“构建”按钮 - Jenkins - Is this possible? Have more than one Build button for a parameter based job 詹金斯的“批量构建”每次都失败 - Jenkins “Batch-Build” fails every time 单击构建时,有没有办法删除每个 Jenkins 作业名称中的“项目”? - Is there a way to remove "Project" in every Jenkins job names when clicking on Build? 如何告诉 Jenkins“在文件夹 X 中构建每个项目”? - How to tell Jenkins "Build every project in folder X"? 如果失败超过 x 次,有没有办法停止 Jenkins 构建步骤 - Is there a way to stop Jenkins build step if fails more than x times Android studio:如何为每个构建版本提供不同的运行配置 - Android studio: How to have different run configurations for every build variant jenkins仅基于一个回购中的更改即可触发构建 - jenkins trigger a build base on changes in just one repo 构建系统以将项目目录中的每个* .CS文件编译为一个可执行文件 - Build system to compile every *.CS file in the project directory into one executable 每次构建(包装)之前都要清洁 - clean before every build (package) Jenkins 从晚上 10 点到第二天早上 7 点每 2 小时定期构建 - Jenkins build periodically every 2 hours after 10 PM to next day 7AM
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM