Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on setting up Jenkins to handle our release builds. A release build consists of a Windows installer that includes some binaries that must be built on Linux.

Here's what I have so far:

  • The Windows portion and Linux portion are set up as separate Jenkins projects.
  • The Windows project is parameterized, taking the Subversion tag to build and release.
  • As part of its build, the Windows project triggers a build of that same Subversion tag for the Linux project (using the Parameterized Trigger plugin) then copies the artifacts from the Linux project (using the Copy Artifact plugin) to the Windows project's workspace so that they can be included in the Windows installer.

Where I'm stuck: Right now, Copy Artifact is set up to copy the last successful build. It seems more robust to configure Copy Artifact to copy from the exact build that Parameterized Trigger triggered, but I'm having trouble figuring out how to make that work. There's an option for a "build selector" parameter that I think is intended to help with this, but I can't figure out how it's supposed to be set up (and blindly experimenting with different possibilities is somewhat painful when the build takes an hour or two to find success or failure).

How should I set this up? How does build selector work?

share|improve this question
up vote 9 down vote accepted

After you've completed a triggered build you'll have a new env variable set to the build number of that triggered build called TRIGGERED_BUILD_NUMBER_<job name>. You can use that to specifically copy back the artifacts:

  1. Windows build (called "WindowsBuild"), calls the Linux build (called "LinuxBuild") using the Parameterized Trigger plugin.

    You've got this part, just make sure to check Block until the triggered projects finish their builds and fail the build of course if the Linux build fails.

  2. Next in your Copy Artifacts from another project step:

    Project name: LinuxBuild

    Which build: Specific build

    Build number: $TRIGGERED_BUILD_NUMBER_LinuxBuild (All Project names have characters not a-zA-Z or 0-9 replaced by _ ; multiple characters are condensed into a single _).

share|improve this answer
should the "$TRIGGERED_BUILD_NUMBER_<downstreamjob>" environment variable be set manually? I cannot find it in either of the upstream or downstream environment variables. – harish Feb 18 '15 at 7:39
Found from plugin wiki that $TRIGGERED_BUILD_NUMBER_<downstreamjob> is set automatically if "Block until the triggered projects finish their builds" is checked. – harish Feb 18 '15 at 7:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.