Using HTTP Request plugin to remote control an IDE

33 views
Skip to first unread message

Amaury Laurent

unread,
Aug 12, 2016, 3:39:32 AM8/12/16
to Jenkins Users
Hi everyone,
 
I'm interested in using HTTP Request Plugin to remotely control our development environment.

My objectives are:
1-Waiting for my builder to start (maybe in Build Environment section of Jenkins)
2-Trigger a build remotely
3-Periodically query its status
4-Retrieve build results from the server
 
Do you think possible to slightly modify the plugin to make it poll a web server until it gives the correct response ?
Will it be difficult to do (I'm not very experienced in Java development) ?

Regards, Amaury LAURENT.

Martin d'Anjou

unread,
Aug 12, 2016, 7:58:06 AM8/12/16
to Jenkins Users
Sounds like you need to implement a couple of polling loops (a loop to wait for the builder, a loop to query the status). I would do that in the Pipeline DSL. That would be easier than modifying the plugin. For example:

def response = httpRequest 'http://localhost:8080/'
while (response.status != 200) {
    sleep
5
    response
= httpRequest 'http://localhost:8080/'
}
// do something with the reponse
println
(response)

// trigger another jenkins job
build
('otherJob')


I do not know what you mean by "trigger a build". There is the Pipeline DSL build() step which calls anothere jenkins job (https://jenkins.io/doc/pipeline/steps/workflow-support/#build-build-a-job), but I am not sure if this is what you mean.

Martin

Amaury Laurent

unread,
Aug 23, 2016, 11:44:00 AM8/23/16
to Jenkins Users
Hi,

I'm trying to implement your suggestion. Pipeline plugin is really awesome!
I stil have some exception problems but it looks good!

By the way, I plan to make a small diagram to explain my project and its architecture.

Thank you for your help.

Regards, Amaury.

Amaury Laurent

unread,
Aug 30, 2016, 11:36:37 AM8/30/16
to Jenkins Users
Reply all
Reply to author
Forward
0 new messages