Programmatically check if Jenkins service is up and running

348 views
Skip to first unread message

Liora Milbaum

unread,
Jul 27, 2016, 7:16:17 PM7/27/16
to Jenkins Users
My chef cookbook deploys Jenkins and few plugins. A restart is required after the plugins are installed.
It takes few seconds to the service coming back. Till than, no additional configuration can be executed on that Jenkins service.
The easiest way is to sleep for lets say 60 seconds and than continue as usual.
But, there must be another way to deal with it. Something like looping till a heartbeat is received.

Any idea how it can be implemented?

Thanks,
Liora

 

Baptiste Mathus

unread,
Jul 28, 2016, 2:58:03 AM7/28/16
to jenkins...@googlegroups.com

Don't know chef myself, but IIRC it's Ruby so you could probably query a URL under /userContent for a file you dropped yourself. And loop for say max 90 until it's there, or fail?

See https://wiki.jenkins-ci.org/display/JENKINS/Administering+Jenkins if you don't know that directory.

HTH


--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d80728b1-09a0-40d1-ad7a-3dbfcad74577%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages