I have a problem and I'm looking for a direct solution or a workaround.
I have 2 jobs on Jenkins: job A (the upstream job) and job B (the downstream job) that needs to be triggered after job A has finished
I used to solve this problem with: "This project is parameterized" set on job A,B and it worked perfectly fine. but on job B it does not work. When I build with parameter job A, jenkins wants a parameter for job A and then triggering Job B. job B needs a new parameter. Jenkins does not want new parameter for job B. I need to give paramateres both projects. Is there any solution ?
Using build parameters, we can pass any data we want: git branch name, secret credentials, hostnames and ports, and so on. Any Jenkins job or pipeline can be parameterized. All we need to do is check the box on the General settings tab, “This project is parameterized”: Then we click the Add Parameter button.
Build after other projects are builtIf your project depends on another project build then you should select Build after other projects are built option from the build triggers. After that, It starts watching the specified projects in the Projects to watch section.
Build parameters are name-value pairs, defined by a user or provided by TeamCity, which can be used in a build. They help flexibly share settings and pass them to build steps. This article explains how to configure build parameters.
Let's say you need to pass PARAM1
and PARAM2
to JOB B
.
Declare PARAM1
and PARAM2
in JOB A
, then pass both the parameters to JOB B
in the post build action in Trigger Parameterized Job
like this:
param1 = $PARAM1
param2 = $PARAM2
Then in JOB B
declare param1
and param2
.
This should do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With