This worked like charm. Thanks for sharing this. It saved my loads of time
as I decided to write a wrapper script to handle of this. Pipeline plugin
came to rescue.
Thanks again Bill!
On Thursday, June 8, 2017 at 3:53:16 PM UTC+5:30, Bill Dennis wrote:
>
> I don' t think the Jenkins CRON spec has seconds resolution.
>
> You can build an orchestrater job that is scheduled to run every 1 minute.
>
> Then in that job, loop 6 times with a sleep of 10 seconds and build
> another job.
>
> Also use the do not allow concurrent builds.
>
> Something like this:
>
> pipeline {
>
>
> agent any
>
>
> options {
> disableConcurrentBuilds()
> timestamps()
> }
>
>
> triggers {
> // Default triggering on a schedule every 1 minute or you can get
> from ENV
> cron("${env.CRON_SCHEDULE?:'* * * * *'}")
> }
>
>
> stages {
>
>
> stage('Trigger Job Every 10s') {
> steps {
> script {
> for(int i = 0;i < 6;i++) {
>
>
> build job:'foo', wait: false
>
>
> sleep 10
> }
> }
> }
> }
> }
> }
>
> Have fun!
>
> --Bill
>
>
> On Wednesday, 7 June 2017 17:07:35 UTC+1, Ashish Kaushik wrote:
>>
>> Hi,
>> I am looking for a solution which allow me schedule a job which can run
>> every 10 secs and also the job should not run if the previous instance has
>> not yet finished.
>>
>> I have checked the plugin store but can't find anything that supports
>> this requirements. Any pointers would be greatly appreciated.
>>
>> Thanks
>>
>> ----------------------------------------------------------------------------------
>> * Ashish *Kaushik
>> SourceFuse Technologies
>>
>> ----------------------------------------------------------------------------------
>>
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/79fdecf1-0aac-40fc-94f7-f8e95457b8ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.