Start a new Job if a Job has not finished after X minutes


#1

Hi

I have a job that depends on waiting for an external service to complete a task.

So sometimes, when the external service takes longer then X minutes I want to start a new Job to keep waiting.

Is this possible in Travis?


#2

You can install the official Travis console client into a builder with gem install travis (a custom installation of a recent ruby is available on a builder out of the box): (sample .yml; build log).

Then you can issue commands with travis with it. Of course, you’ll need to provide an API key (as a secret variable probably) to be able to issue authenticated commands. Make sure to use --no-interactive for all its invocations; otherwise, it asks an interactive question that hangs the build.