0

I created a job( parameter build) which is running on master, In post-build action I am using Trigger parameterized build on other projects option where I am configured job2 which is running on slave machine. And I selected add parameters as current build parameters. still I am unable to use the parameter from job1. how to share the same parameters from job1 to job2.

NOTE: Parameterized Trigger plugin has been installed.

sampath
  • 185
  • 4
  • 6
  • 14
  • Please provide examples of your parameter on job1, and how/where you are trying to use it. –  Apr 12 '16 at 12:32
  • I am using Build_ID as a parameter and value like Build_number using that Build_ID I am packing the final artifacts and moving to slave machine. after that I need to execute another job to untar the final artifacts in slave and execute one sh file to deploy the files to server so I need to use the same Build_ID for job 2. kindly help how to configure. – sampath Apr 12 '16 at 13:03
  • I think you can't use the same build parameter, as it has the slave job build info in the slave job's run. You might be able to use a custom parameter and have its value come from the BUILD_ID, but I'd go with the Copy Artifact Plugin which is made specifically for fetching artifacts from another project. You could use it to have Jenkins copy the artifacts to a specific folder in the target job, and you can decode the original BUILD information from the tar file name if you need it for anything else. – Rafi Goldfarb Apr 13 '16 at 06:04

1 Answers1

0

Install Parameterized Trigger plugin and in post build action select Trigger parameterized build on other projects. Mention the slave job name on Projects to build,Select Predefined parameters in Add Patameter mention the value as Build_ID=${BUILD_ID}. and go to the slave job and click on This build is parameterized Select the String parameter mention name as Build_ID and Default value as ${BUILD_ID}. now the same parameter will refer for job2 which is running on slave.

please refer the screensenter image description hereenter image description here

sampath
  • 185
  • 4
  • 6
  • 14