Is it possible to trigger a build of a job from a Build Flow job whose 
execution does not block the execution of the calling job?

If that's not clear, say I have three Jenkins jobs: flow-job, short-job, 
long-job. "flow-job" is used to trigger a build of both "short-job" and 
"long-job". However, as implied by their names, one job normally takes much 
longer than the other. Using the build() function in the build flow DSL, 
flow-job won't exit until both short-job and long-job have completed. 
However, I would like for both the short and long job to be triggered by 
the flow DSL, but for flow-job to only wait for short-job to complete: 
long-job should be allowed continue operation after flow-job has completed.

Is there any functionality in the flow DSL that would allow this? I've put 
together a system by which groovy will execute a curl command to trigger 
the long running job:

        def vars = "FOO=BAR&BAZ=QUX";
        def trigger_url = 
"http://localhost:8080/job/long-job/buildWithParameters?${vars}";;
        def cmd = "curl -o trigger.log ${trigger_url}";
        out.println(cmd);
        def proc = cmd.execute();
        proc.waitFor();

and trigger the short running job normally with build("short-job").

This feels a bit messy to me. Is there any native way within the DSL to 
achieve this?

-- 
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/571e33fe-d41d-4e59-8dc1-4c7e15b915e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to