1

I have a job that updated my workspace and after will compile projects.

I need have a job (A) for update my workspace and other job (B) that first executed the job A (like a prebuild) and after will compile my project.

hdmq
  • 277
  • 1
  • 4
  • 14
  • 1
    Do you familiar with `upstream` and `downstream` projects roles https://wiki.jenkins-ci.org/display/JENKINS/Terminology ? – Gluttton Oct 02 '14 at 16:55

1 Answers1

4

Under the "Build Triggers" option on the job configuration page, check the "Build after other projects are built" checkbox, and then enter the name of the precursor job in the textbox which appears. You can also configure whether you would like the job to run only if its precursor is stable, for example.

So in this case, you would configure job B to run upon completion of job A (as described above), probably requiring that job A completed successfully.

Richard Williams
  • 291
  • 2
  • 11
  • I configured a job "A" (that will update the workspace). In other job "B", in the option "Build Triggers" I checked "Build after other projects are built" and in "Projects to watch" I added the job "A". But, when I execute the job "B" in the console output there is nothing to indicate that the job A was completed. I need: - Not display the log when be update the workspace when execute the job B. - Just write that the job "A" is finish and execute the job B. Is this possible? – hdmq Oct 02 '14 at 20:26
  • I'm afraid I don't quite understand the second part of your comment - would you mind rephrasing for me please? However, from the first part of your comment, it sounds like you may be doing things the wrong way round. If you configure job B with the "Build after other projects are built" option, then it's job A that you need to execute for job B to run subsequently. If you execute job B directly, then that's the only job that will run, as job A has no rules telling it to run after job B. – Richard Williams Oct 02 '14 at 20:35
  • I need exactly this: "then it's job A that you need to execute for job B to run subsequently" – hdmq Oct 02 '14 at 21:09
  • Execute first the job "A", after the job "B" (like a pre-Build) – hdmq Oct 02 '14 at 21:13
  • Okay, well you should be able to achieve that by configuring job B to have the "Build after other projects are built" option and then by directly executing job A (which will automatically run job B afterwards). Or have you done that but it doesn't work? – Richard Williams Oct 02 '14 at 21:16
  • No is exactly the that I need. I need just execute first A when execute B, but transparently, and when finish of execute A, start with B. Job A: just update workspace (this job be will use in "n" jobs) My goal is: - When execute "A" not display the log of the updated the workspace, for that so the "console output" only displaying the important of the execute job B – hdmq Oct 02 '14 at 21:56
  • I'm afraid I'm not sure how to do something quite that specific, sorry; but perhaps someone else will know. :) – Richard Williams Oct 02 '14 at 22:15
  • I finally solved, In the job "B" in the option "Build/Trigger/call builds on other projects" added the job "A". The result is that when executed the jobs "B", first executed the job "A" and by last is executed "B". Note: The settings in jenkin must allow run two queues. – hdmq Oct 03 '14 at 15:49
  • This solution finished using the "Parameterized Trigger Plugin". – hdmq Oct 03 '14 at 16:28