CruiseControl.net cronTrigger混乱 [英] CruiseControl.net cronTrigger confusion

查看:84
本文介绍了CruiseControl.net cronTrigger混乱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在cc.net中为同一Web应用程序设置了2个项目。一个连续的集成项目,该项目使用时间间隔触发器并可以正常工作,而一个夜间构建项目则使用cronTrigger。夜间构建实质上是构建和部署登台/测试服务器,以便人们可以进行测试而不会在每次有人提交时受到重建的干扰。我想做的是让它每天早上6点自动构建,如果您要构建其他任何时间,则可以强制构建。我使用的cron表达式是 0 6 * * * ,我认为这是正确的,并且似乎在cc.net中正确设置了下一个构建时间。我遇到的问题是,如果我将构建条件设置为IfModificationExists,那么自上次构建以来没有任何修改,则它不会在计划的时间构建,这很好,但是只要有人提交,它就会构建,这不是我想要的,我希望它等到下一个预定时间。因此,我尝试将构建条件设置为ForceBuild,我认为无论是否有任何提交,它都会每天凌晨6点构建,但这似乎并不能使其不断地重复生成。我想念做错了什么?

I have setup 2 projects in cc.net for the same web application. A continuous integration project that uses an interval trigger and works fine and a "nightly build" project that uses a cronTrigger. The nightly build essentially builds and deploys the staging/testing server so that people can test without being interrupted with a rebuild every time someone does a commit. What i want to do is have it auto build every morning at 6 am and allow force builds if you want to build any other time. THe cron expression I am using is 0 6 * * *, which i think is correct and seems to set the "next build time" correctly in cc.net. The problem I am encountering is that if i set the build condition to IfModificationExists then if there are no modifications since the last build, it doesn't build at the scheduled time, which is fine, but as soon as someone commits, it builds, which is not what i want, i want it to wait until the next scheduled time. So I tried setting the build condition to ForceBuild which i thought would just make it build at 6 AM every day regardless of whether there were any commits, but it doesn't it seems to make it build constantly over and over again. What am i missing doing wrong?

编辑
不知道这是否真的提供了更多有用的信息,但需要进一步评论。

EDIT Not sure if this really provides any more usefull info but further to a comment.

<triggers>
    <cronTrigger>
      <buildCondition>IfModificationExists</buildCondition>
      <cronExpression>0 6 * * *</cronExpression>
    </cronTrigger>
  </triggers>

OR

 <triggers>
        <cronTrigger>
          <buildCondition>ForceBuild</buildCondition>
          <cronExpression>0 6 * * *</cronExpression>
        </cronTrigger>
      </triggers>


推荐答案

来自: http://build.sharpdevelop.net/ccnet/doc/CCNET/Cron%20Trigger.html

单个表达式由5个以空格分隔的字段组成:
数小时时数MONTHS DAYS-OF-WEEK

A single expression is composed of 5 space-delimited fields : MINUTES HOURS DAYS MONTHS DAYS-OF-WEEK

示例:

此触发器将在每月的第5天执行

This trigger will execute 5th day of every month

<triggers>
    <cronTrigger>
        <cronExpression>0 0 5 * *</cronExpression>
    </cronTrigger>
 </triggers>

此触发器将每天在凌晨5点执行

This trigger will execute every day at 5am

<triggers>
    <cronTrigger>
        <cronExpression>0 5 * * *</cronExpression>
    </cronTrigger>
</triggers>



问候,
Dejan


Regards, Dejan

这篇关于CruiseControl.net cronTrigger混乱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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