简体   繁体   中英

Jenkins build job execute jobs in parallel how to create the programmatically without creating pipeline in jenkins GUI

i have 2 functions which I like to execute them in parallel, each job will run on slave or where there are enough resources. the problem is that I dont want to create pipelines in Jenkins GUI and then from that pipeline to execute my function. i like to be able to create the pipeline on the fly in code. this is example what i have now :

//downstream job
build job: "my_job_pipeline_1",
parameters: [string(name: 'PROJECT_NAME', value: "${PROJECT_NAME}"),
propagate: false,
wait: true


//downstream job
build job: "my_job_pipeline_2", 
parameters: [string(name: 'PROJECT_NAME', value: "${PROJECT_NAME}"),
propagate: false,
wait: true 

This called from my main pipeline but for this to work I have to create 2 pipelines in Jenkins GUI
my_job_pipeline_2 and my_job_pipeline_1
can i create those pipelines programmatically ?

The Jenkins CLI allows you to create jobs from the terminal. Follow the documentation to set it up. Under Manage Jenkins > Jenkins CLI you can find the available commands (including "create job")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM