0

I want to start a new Jenkins job by uploading a single file as a file parameter.

I have not been able to make it work with a single declarative pipeline job.

I have read many posts here, but I have not found a definitive guide or method to do it.

Could you please provide an example or link?

The problem with the pipelined job is that it is not clear where the file parameter is available.

So far, I have managed to have a freestyle job receiving the file, and then it copies the file to a directory where a second (pipeline) job takes it. The pipeline job is started by the freestyle job. An awful solution from any point of view, but it works.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
lukipedio
  • 16
  • 4
  • 1
    What kind of jenkins job it is ? Do you want to deploy a remote project (like a github project, for example) ? – Myriam K. Oct 04 '21 at 12:40
  • The following post suggests a solution, but I cannot make it work: https://stackoverflow.com/questions/50733526/how-to-upload-a-file-to-jenkins-pipeline-job-as-build-parameter/69436005#69436005 – lukipedio Oct 04 '21 at 12:44
  • @MyriamK. No, that's the tricky point. I want to start a job from a zip file containing all the information for the job. Source code repo is not allowed in my case. – lukipedio Oct 04 '21 at 12:51
  • 1
    Compared to what you answered me, I found this : https://stackoverflow.com/questions/38080876/jenkins-pipeline-job-with-file-parameter – Myriam K. Oct 04 '21 at 13:03

0 Answers0