jenkins to get build number from 2 different jobs - jenkins

Right now I use "Run" parameter in a job that retrieves last successful build of another job to this job. This parameter gives me a dropdown of all last successful builds and I can manually choose any build and use it in my current job. But now I want to extend it to choose last successful build from 2 different jobs i.e. my current job should be able to see all successful builds in 2 different jobs and be able to choose any job of the choice. How do i do this in Jenkins. (Note: I do not want 2 different Run parameters- one for each job. It should be a single choice)

Related

triggering the dependant builds to run it as the independant one as per the choice

I'm setting up the pipeline in jenkins it have the dependant jobs since it needs the parameter form the previous builds but when it is triggered it should not wait for the previous builds it should be triggered and the build should be runs independantly.
I have tried this by using the conditional buildstep plugin.It too depends on the previous builds and the parameters from them.
The user must be able to choose their own builds to get triggered for the builds though it is the dependant one ..it shouldn't wait for the previous builds ,the user desired jobs should start run for the builds

Jenkins executing one job that runs multiple jobs

i am new to Jenkins , i need to execute one job that run's another multiple jobs in parallel were it should not stop even if one job fails.
i am not sure how to achieve it. After googling i can achieve by 3 ways Multi-Job plugin , Pipeline multiple Jenkins jobs , Build after other projects , Build Flow Plugin.
can any body please provide me the correct way.
Update : i am trying to achieve this using the pipeline plugin , can any body suggest me were it was correct choice ?..Please suggest!..
We use the Parameterized Trigger Plugin to do this.
In your build configuration add a Trigger/call builds on other projects build step. Add the names of the builds you want to trigger as a comma separated list and make sure that the Block until triggered projects finish their builds box is unchecked. Your build will trigger each of the listed builds, however note that your parent build won't wait for them to finish it will just trigger them and then perform the rest of it's buildsteps so if you have buildsteps.
If you do want to wait then check the block until triggered builds finish box, but set the options for when to fail the build, build step or mark the build as unstable appropriately.
If you need to pass parameters to the jobs you can add parameters using this plugin. If your downstream jobs need different parameters for different jobs you can click the add trigger button which adds another project to build where you can specify different options.
If these other jobs are follow up jobs to the current job and you don't need to wait for them to finish you can also achieve what you want to do by using the post build action build other projects, but again this occurs after the current job and you won't be able to use the results.
can any body please provide me the correct way.
I wouldn't approach using Jenkins with a "one correct way" mentality. Often times the requirements of your build will dictate which method or plugin you use in your build configurations.
The job can start other jobs via the jenkins api.
updated Answer : i used pipeline plugin to achieve my task and tuffwer was right to if u have paramaterized trigger plugin!..

Jenkins: launch same job with different parameters

I have a job to maven build our project, we now have one job per release version. As the number of releases grows, there are too many jobs and very hard to find the one we need.
I wonder if there is a way to launch the same job with different parameters? The problem is one job only has one workspace, so I'm not sure if it's possible?
Thanks.
Use This build is Parameterized option to build the jobs. Using this you can build the same job for different parameters. You will be asked to enter the parameter before building or you can also give a default parameter and you can have multiple parameters.
It is good the archive the artifacts which you need later.
You can also have the option keep build forever, this will keep the builds permanently Ir-respective of the number of builds to keep.
To use above option you should enable Discard old build option.
You can also link your repository directly to Jenkins which will trigger the job whenever a new commit is made to master or a new tag is created.

Jenkins to run 10 jobs sequestially and few parallely and only run jobs what I choose

Jenkins to run 10 jobs sequentially and few parallely and let say 1-2 jobs are successful and job3 failed. I fixed the job3.Now I want to again trigger the job but only want to trigger it from job3.All 10 jobs have string parameter.
I can pick an choose what jobs to trigger. how can I achieve it.Please help.
The whole point of CI is to have multiple runs frequently, so that in next run you can see them all stable. Not sure why you wanted to do this. However, You can take 2 approaches.
You can use conditional Step plugin along with multiphase plugin,
wrap you build step with condition and pass whether you want to run
it or not. only if the condition is passed then the individual jobs
will be triggered.
You can use jenkins-cli and trigger the jobs
which ever you wish.

jenkins promoting builds with Paramaterized build parameters

I have Job A and Job B. Job A is having it's own few build parameters settings and Job B is having it's own other build parameters. Now, I want to promote few selected builds from Job A to Job B using promoted builds plugin by providing user inputs for the required parameters to Job B. Let me know how we can prompt and get the values for Job A build promotion.
Regards,
Srinivas
For general usage of promotions with builds, read this answer How to promote a specific build number from another job in Jenkins?. It may give you ideas so that you won't have to pass extra parameters manually.
If you still need to provide parameters to Job B, here are some options:
Create multiple promotions on Job A triggering the same Job B, but with different parameters (through Parameterized Trigger plugin). This is essentially what I am doing in the linked answer. I have 1 deployment job (Job B) which takes various parameters for various environments. And I trigger it by having multiple promotions on build job (Job A), such as "Deploy to DEV", "Deploy to QA", and so on. Obviously this only works when you have a finite number of parameters to pass to Job B.
Use "manual approval" checkbox. When checked, you can further provide "Approval Parameters". The approving user will be prompted to provide those when clicking "Approve" button. Please note that "manual" approval parameters cannot be changed with "Force Promotion/ Re-execute Promotion" buttons.

Resources