gvalkov / jenkins-autojobs

Automatically create Jenkins jobs from template jobs and branches in a SCM repository
http://jenkins-autojobs.rtfd.org
Other
49 stars 39 forks source link

Do not create jobs for closed branches in mercurial #48

Closed qatesterforever closed 8 years ago

qatesterforever commented 9 years ago

Hi, I am running jenkins-makejobs-hg using the basic instructions, but it seems to be creating new jobs for branches that are already closed. I am also running multiple instances of jenkins-makejobs-hg so I am setting cleanup : false. Is there a way to configure it such that it only creates jobs for mercurial branches that are not closed?

Thank you so much!

gvalkov commented 9 years ago

Hello @qatesterforever,

I'm afraid this is the only available behaviour at the moment. Listing only open branches is easy to do with a local repository, but I haven't found a way to do it with remote mercurial repositories. As soon as I figure it out, I'll add something like a list-closed: true to the config file.

In the meantime, you can just remove the -c flag from hg.py/hg_branch_iter_local() if you're using a local repository.

Kind regards, Georgi

qatesterforever commented 9 years ago

Ok great thank you for your quick response. I'll try your recommendation with a local repo as soon as I can and post my findings.

gvalkov commented 9 years ago

No problem. I added the list-closed option in 0f92ba46cf0c3505e550903a6f2919cbea231d4a, with a warning that it works only for local repositories.

qatesterforever commented 8 years ago

I upgraded and set the list-closed=false and it is still processing closed branches. These are my settings: repo: file:///var/lib/jenkins/ list-closed: false

qatesterforever commented 8 years ago

Actually I take my last comment back. I was using the wrong repo setting format. Once I set my repo setting like this "repo: /var/lib/jenkins/" the list-closed option was respected.

Thank you for the fix!

gvalkov commented 8 years ago

I'm glad it works.