Force a build on a periodic schedule even if no changes?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Force a build on a periodic schedule even if no changes?

Chad Woolley
Setting polling_interval will only cause build if there are changes.
I want to build always on a schedule (yes I have a good reason).  I
can't see an easy way to make this happen - it would take some hacking
on SuccessfulBuildTrigger and/or PollingScheduler.

Has anyone made this work?  I seem to remember it being discussed, but
don't see anything in the source...

-- Chad
_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
Reply | Threaded
Open this post in threaded view
|

Re: Force a build on a periodic schedule even if no changes?

Chad Woolley
On Mon, Jan 11, 2010 at 7:16 PM, Chad Woolley <[hidden email]> wrote:
> Has anyone made this work?  I seem to remember it being discussed, but
> don't see anything in the source...

Just committed a change to support this:

http://github.com/thoughtworks/cruisecontrol.rb/commit/0cd553ffd5d6ed249508954bb305ba18e9000459

Lemme know if there are any problems.

Also, looks like CI is working again.  Good!

-- Chad
_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
Reply | Threaded
Open this post in threaded view
|

Re: Force a build on a periodic schedule even if no changes?

Brian Guthrie-2
Hi Chad,

I built a plugin a little while back that acts as a separate trigger,
but your way seems much simpler. Thoughts? Would be happy to commit
this if it seems preferable.

Brian

class ScheduledBuildTrigger
  attr_accessor :build_interval

  def initialize(triggered_project, opts={})
    @triggered_project = triggered_project
    @build_interval = opts[:build_interval] || 24.hours
    @next_build_time = opts[:start_time] || calculate_next_build_time
  end

  def build_necessary?(reasons)
    if @triggered_project.build_requested? || time_for_new_build?
      @next_build_time = calculate_next_build_time
      true
    end
  end

  def calculate_next_build_time
    Time.now + @build_interval
  end

  def time_for_new_build?
    Time.now >= @next_build_time
  end
end

On Tue, Jan 12, 2010 at 3:34 AM, Chad Woolley <[hidden email]> wrote:

> On Mon, Jan 11, 2010 at 7:16 PM, Chad Woolley <[hidden email]> wrote:
>> Has anyone made this work?  I seem to remember it being discussed, but
>> don't see anything in the source...
>
> Just committed a change to support this:
>
> http://github.com/thoughtworks/cruisecontrol.rb/commit/0cd553ffd5d6ed249508954bb305ba18e9000459
>
> Lemme know if there are any problems.
>
> Also, looks like CI is working again.  Good!
>
> -- Chad
> _______________________________________________
> Cruisecontrolrb-developers mailing list
> [hidden email]
> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
>
_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
Reply | Threaded
Open this post in threaded view
|

Re: Force a build on a periodic schedule even if no changes?

Chad Woolley
On Mon, Jan 11, 2010 at 8:41 PM, Brian Guthrie <[hidden email]> wrote:
> Hi Chad,
>
> I built a plugin a little while back that acts as a separate trigger,
> but your way seems much simpler. Thoughts? Would be happy to commit
> this if it seems preferable.

This seems cleaner.  I was lazy so I just hacked it onto the polling
scheduler.  Not sure how you configure it, though -   It should have
an example of how to use it in the cruise_config example.

I'm fine if you want to commit this and revert mine.  I just need to
have something working by tomorrow, so give me a heads up if you
revert so I can switch over to yours.

-- Chad
_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
Reply | Threaded
Open this post in threaded view
|

Re: Force a build on a periodic schedule even if no changes?

Brian Guthrie-2
Hi Chad,

I've pushed in the ScheduledBuildTrigger and the build passes. Let me
know if you run into any issues.

Cheers,

Brian

On Tue, Jan 12, 2010 at 4:13 AM, Chad Woolley <[hidden email]> wrote:

> On Mon, Jan 11, 2010 at 8:41 PM, Brian Guthrie <[hidden email]> wrote:
>> Hi Chad,
>>
>> I built a plugin a little while back that acts as a separate trigger,
>> but your way seems much simpler. Thoughts? Would be happy to commit
>> this if it seems preferable.
>
> This seems cleaner.  I was lazy so I just hacked it onto the polling
> scheduler.  Not sure how you configure it, though -   It should have
> an example of how to use it in the cruise_config example.
>
> I'm fine if you want to commit this and revert mine.  I just need to
> have something working by tomorrow, so give me a heads up if you
> revert so I can switch over to yours.
>
> -- Chad
> _______________________________________________
> Cruisecontrolrb-developers mailing list
> [hidden email]
> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
>
_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
Reply | Threaded
Open this post in threaded view
|

Re: Force a build on a periodic schedule even if no changes?

Chad Woolley
On Tue, Jan 12, 2010 at 12:55 AM, Brian Guthrie <[hidden email]> wrote:
> Hi Chad,
>
> I've pushed in the ScheduledBuildTrigger and the build passes. Let me
> know if you run into any issues.

One problem with this is that it won't build if there are SCM changes
(which I want, and my prior change supported).  Should we put my
changes back and support both approaches?  If this is OK, I'll do it,
and put appropriate explaination in cruise config example.
_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
Reply | Threaded
Open this post in threaded view
|

Re: Force a build on a periodic schedule even if no changes?

Brian Guthrie-2
Sure, I buy that. Go for it.

On Tue, Jan 12, 2010 at 11:35 PM, Chad Woolley <[hidden email]> wrote:

> On Tue, Jan 12, 2010 at 12:55 AM, Brian Guthrie <[hidden email]> wrote:
>> Hi Chad,
>>
>> I've pushed in the ScheduledBuildTrigger and the build passes. Let me
>> know if you run into any issues.
>
> One problem with this is that it won't build if there are SCM changes
> (which I want, and my prior change supported).  Should we put my
> changes back and support both approaches?  If this is OK, I'll do it,
> and put appropriate explaination in cruise config example.
> _______________________________________________
> Cruisecontrolrb-developers mailing list
> [hidden email]
> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
>
_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
Reply | Threaded
Open this post in threaded view
|

Re: Force a build on a periodic schedule even if no changes?

Chad Woolley
On Tue, Jan 12, 2010 at 4:39 PM, Brian Guthrie <[hidden email]> wrote:
> Sure, I buy that. Go for it.

Added back:

http://github.com/thoughtworks/cruisecontrol.rb/commit/ac38eeda532b34a60364cc02ab7b9ed8822a695d
_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers