2012/6/14 Miguel Almeida <migueldealme...@gmail.com>:
> Hi Sami,
>
> Thanks for the tips. I do have a coulpe of follow-up questions:
>
>
> On Tuesday, June 12, 2012 11:44:08 PM UTC+1, sti wrote:
>>
>> Configure the Deploy job to also check out source code from SCM (even
>> though it would not use it) and make it poll only at midnight.
>
>
> You mean make it check out from SCM instead of clone Test job's workspace?
> How will that prevent theĀ  job from running? Does Jenkins not run the job if
> there aren't any changes in the SCM?

That's correct.

>> Alternatively, make the Test job trigger a job which waits until next
>> midnight and then triggers Deploy.
>>
>
> You'll might stack up a lot of deploy jobs, though, won't you? ie, if you
> have 3 commits in one day, Test will run 3 times and it'll trigger the
> Deploy 3 times, right?

Hmm... you're right. The first Deploy would run, discover it is not
midnight and sleep. The next trigger for Deploy would place Deploy in
the queue. The next would not add a new Deploy into the queue because
one is already there.

When the midnight comes, Deploy would do it's thing and finish and
then the Deploy in the queue would run, maybe discover it is not
midnight and decide to sleep until the next midnight.

This is probably not what you want, so maybe better to go with the
source checkout.

-- Sami

>
> Miguel
>
>> -- Sami
>>
>> Miguel Almeida kirjoitti 12.6.2012 kello 14.30:
>>
>> > Dear all,
>> >
>> > I have a Maven project with two jobs:
>> > 1) Test - runs all tests (with surefire), and runs on every SCM commit
>> > 2) Deploy - deploys the new version on a server, and runs once at
>> > midnight
>> >
>> > Everything is running great. However, we're now on a phase where changes
>> > don't happen very often. Still, every night the deploy job redeploys the
>> > project. Ideally, if no commits were performed that day, there is no need
>> > for the deploy job to run.
>> >
>> > Is there a way to "run project only if there were changes in the
>> > upstream since the previous run" ?
>> >
>> >
>> > Cheers,
>> >
>> > Miguel Almeida
>>
>

Reply via email to