jenkins-zh / jenkins-cli

Jenkins CLI allows you to manage your Jenkins in an easy way. Jenkins 命令行客户端
http://www.jenkins-zh.cn/jenkins-cli/
MIT License
389 stars 78 forks source link

jcli job edit for multibranch pipeline jobs #663

Open natsen opened 2 years ago

natsen commented 2 years ago

Is your feature request related to a problem? Please describe. jcli job edit is non functional for multibranch pipeline. This is because the job is sourced from a Jenkinsfile in SCM. Describe the solution you'd like jcli job edit can provide an option to edit and run the job using the replay api for jobs that are sources from Jenkinsfile in SCM.

natsen commented 2 years ago

jcli job edit does edit the multibranch pipeline by changing Pipeline Definition in the configuration for the branch from "Pipeline from multbrach configuration" to "Pipeline script". This is great. One thing I observed though is edit and build option fails with 400 error. I will create a different bug for that. Will close this. jcli job edit -b "mutibranch-job branch" -f mypipeline.groovy fails with 400 error. This might be because the job expects parameters. edit and build doesn't ask for parameters.

natsen commented 2 years ago

although jcli edit multibranch pipeline provides an option to run any pipeline script, it does not have ability to edit currently pipeline script sourced from Jenkinsfile in SCM. Keeping this open.