I'm implementing a way to trigger jenkins jobs and to schedule them with php in my site. The way I'm doing the "on-the-fly" trigger is by simply calling the url of the job with some parameters (I'm also using Build Token Root Plugin so I can trigger the jobs without authentication).
Example below:
$data = array(
'job' => 'JOB NAME',
'token' => 'job_token',
'parameter1' => 'some parameter',
);
$options = array(
'method' => 'POST',
'data' => drupal_http_build_query($data),
'timeout' => 15,
'headers' => array('Content-Type' => 'application/x-www-form-urlencoded'),
);
drupal_http_request('http://localhost:8080/buildByToken/buildWithParameters', $options);
I can trigger the job with multiple parameters but I need to schedule the build. In jenkins there is this option "Build periodically" but it's not a parameter.
Anyone knows a way to schedule the job trough the url way?
Thanks!