CruiseControl.net cron触发混乱

发布于 12-03 11:21 字数 1024 浏览 2 评论 0原文

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

编辑 不确定这是否真的提供了任何更有用的信息,但进一步发表评论。

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

或者

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

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

人间☆小暴躁2024-12-10 11:21:39

如果你想每天跑步

<scheduleTrigger time="06:00" buildCondition="ForceBuild" name="Scheduled"></scheduleTrigger>

,有人知道如何解决这个问题吗?我每月运行一次时也遇到类似问题。

If you wants to run every day use

<scheduleTrigger time="06:00" buildCondition="ForceBuild" name="Scheduled"></scheduleTrigger>

Someone, knows how to solve this?? I have similar problem running once a month.

因为看清所以看轻2024-12-10 11:21:39

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

单个表达式由 5 个空格分隔的字段组成:
MINUTES HOURS DAYS MONTHS DAYS-OF-WEEK

示例:

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

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

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

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

问候,
德扬

Taken from: http://build.sharpdevelop.net/ccnet/doc/CCNET/Cron%20Trigger.html

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

Examples:

This trigger will execute 5th day of every month

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

This trigger will execute every day at 5am

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

Regards,
Dejan

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文