Createing job through CLI

15 views
Skip to first unread message

Mike Craig

unread,
Jul 2, 2014, 2:48:35 PM7/2/14
to jenkins...@googlegroups.com
Hello,

I am using the Jenkins CLI to pull down a list of 'template' jobs, search and replace for our release version, then "create" a job using the job XML which I have pulled from Jenkins.

The template job uses "promoted builds" plugin to have CI, "Directed Build", ReleaseCandidate, ReleasetoProduction promotion steps.

However, when I pull down the template job description, do my replace, and perform the Create, I'm not getting the Promoted Builds configuration included in the new job.

I have wrapped all of the Java CLI calls in Powershell, I'd be happy to send out the script if someone would like to look at it.

Otherwise, any ideas how I can get a New Job created and include the Promoted Builds configuration?

Note: To fix this I have manually copied the following folders from the template job to my new job:
promotions\CI-Complete
promotions\DirectedBuild
promotions\QA-Ready
promotions\Release
promotions\ReleaseCandidate
promotions\ReleaseToProduction
promotions\CI-Complete\config.xml
promotions\CI-Complete\nextBuildNumber
promotions\DirectedBuild\config.xml
promotions\DirectedBuild\nextBuildNumber
promotions\QA-Ready\config.xml
promotions\QA-Ready\nextBuildNumber
promotions\Release\config.xml
promotions\Release\nextBuildNumber
promotions\ReleaseCandidate\config.xml
promotions\ReleaseCandidate\nextBuildNumber
promotions\ReleaseToProduction\config.xml
promotions\ReleaseToProduction\nextBuildNumber

I would think the CLI Create command would do all of this.

Thank you.

Mike

jv

unread,
Jul 3, 2014, 7:37:03 AM7/3/14
to jenkins...@googlegroups.com
copy-job and update-job. Copy-job will copy all promotions. This is what we are doing[1].

[1] https://github.com/hzh/create-job-cli
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Levine

unread,
Mar 20, 2017, 3:27:15 PM3/20/17
to Jenkins Users
Promoted build has a special subfolder, promotions, in the same dir as the config.xml.  In the promotions directory, there is a directory for each promotion name/stage, each with a config.xml.   It's quite possible those subfolders are not being copied over because they're a one-off.

Adam Levine

unread,
Mar 20, 2017, 3:29:40 PM3/20/17
to Jenkins Users
oops, didn't realize I posted on a 3yr old thread.


On Wednesday, July 2, 2014 at 1:48:35 PM UTC-5, Mike Craig wrote:
Reply all
Reply to author
Forward
0 new messages