0

I have two Jenkins jobs A1 and A2 that retrieve the project from SVN, and job B which builds it. Jobs A1 and A2 both retrieve the codebase, but you can paremeterize them differently. Both reuse job B for building.

Job B copies the artifacts from upstream job, but my problem is that you can only specify one upstream job. I need to specify that job B can retrieve artifacts either A1 or A2, depending on which one striggered the downstream job. Any ideas?

1 Answer 1

1

This is a somewhat unusual way to structure your builds. Usually people prefer to check out the sources in the same job that builds the sources. It keeps things simple and is usually much faster than using Jenkins' artifact copying which, let's face it, isn't the fastest way to move stuff around.

But if you really think that's the proper way for you to do it, have you tried providing the job name as a parameter? When A1 triggers B, it should pass "A1" as a parameter and so on.

The built-in Jenkins post-build action can trigger other jobs but it cannot pass parameters. You can install https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin which is able to trigger other jobs with parameters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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