Is there a dryrun mode for jenkins-jobs update?

21 views
Skip to first unread message

Tony Chia

unread,
Feb 15, 2024, 3:44:47 PM2/15/24
to jenkins-job-builder
Hi,
Is there a way to get the number of jobs updated/deleted before actually executing the "jenkins-jobs update" command? 

i.e. I would like to see something like 

INFO:jenkins_jobs.cli.subcommand.update:Number of jobs deleted: 141
Maybe a jenkins-jobs plan command similar to a "terraform plan" command would give? 

I tried using the "jenkins-jobs test" command but it just verify the syntax and didn't contact the server to do the diff. 

Thanks,
Tony Chia

Vsevolod Fedorov

unread,
Feb 16, 2024, 4:00:52 AM2/16/24
to Tony Chia, jenkins-job-builder

Hi, Tony.

There is no such feature in JJB.

We do this by calling `jenkins-jobs test -o <dir>`, then use `jenkins.Jenkins(,,,).get_jobs()` from `python-jenkins` python package API and compare results.
We also check if a job was created using JJB by checking if there is `Managed by Jenkins Job Builder` string in retrieved (using `get_job_config` method from python-jenkins) job description.


Vsevolod.

--
You received this message because you are subscribed to the Google Groups "jenkins-job-builder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkins-job-bui...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkins-job-builder/5b0c1ad2-31e9-4901-a7b5-900c5e8bc2acn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages