How to pass build parameters from one project to another project?
Do we have any configuration in the Jenkins User interface which would pass build parameters of one build project after finishing it to another project?
I am able to trigger the other project but unable to pass build parameters. Do we have any scope of build parameters so that I can use it in all projects?
Under Build Environment check Set environment variables through a file. give the path of that file here. If the environment variable is created in the first job then again you can save all the environment variable in a file and browse it using the above method. Install this plugin and go to job configuration paeg.
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.
The following are some of the best practices you can follow while using parameters in a Jenkinsfile. Never pass passwords in the String or Multi-line parameter block. Instead, use the password parameter of access Jenkins credentials with credential id as the parameter. Try to use parameters only if required.
To do this, first install Parameterized Trigger Plugin
Then your first job configuration:
I use "Predefined parameters" and in the filed, I define like
[email protected]
build.user.id=abce
mailPassWord=${mpWord}
Values set in those variable will be available for you in your second job selected under "Projects to build".
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