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

Use autojobs for multiple projects within one svn repo without defining 1 branch for each project #32

Closed lxndrhnz closed 9 years ago

lxndrhnz commented 9 years ago

Hi,

we have a svn repo with the following structure:

/path/to/my/repo
|-prjA/
| |-trunk
| |-tags
| +-branches
|
|-prjB
| |-trunk
| |-tags
| +-branches
|
|-subgroup
| |-prjC
| | |-trunk
| | |-tags
| | +-branches
| |
| +-prjD
|   |-trunk
|   |-tags
+   +-branches
...

There are more than 50 small projects in this repo.

I want to use autojobs to create a jenkins job for each prj/trunk and for each prj/branches/* (for all projects in repo root and in the subgroups). All jobs can share the same template.

The only way that seems to work is to configure each trunk and each branches folder (or at least each project) as one item under the branches: element in the yaml config. That is quite verbose, talking about 50+ projects.

Is there a way to provide just the repo and give patterns like:

(.*)/trunk
(.*)/branches/(.*)

without naming each project and autojobs still knows what to do?

Best regards, Alex

gvalkov commented 9 years ago

Hello Alex,

I'm afraid this is not possible at the moment. However, such a feature makes a lot of sense and I'll definitely look into adding it.

I'm currently on vacation and the earliest I can work on this would be late next week.

Kind regards, Georgi On 4 Feb 2015 07:30, "lxndrhnz" notifications@github.com wrote:

Hi,

we have a svn repo with the following structure:

/path/to/my/repo prjA/ trunk tags branches prjB trunk tags branches subgroup prjC trunk tags branches ... There are more than 50 small projects in this repo.

I want to use autojobs to create a jenkins job for each prj/trunk and for each prj/branches/* (for all projects in repo root and in the subgroups). All jobs can share the same template.

The only way that seems to work is to configure each trunk and each branches folder (or at least each project) as one item under the branches: element in the yaml config. That is quite verbose, talking about 50+ projects.

Is there a way to provide just the repo and give patterns like (. )/trunk (.)/branches/(.*) without naming each project and autojobs still knows what to do?

Best regards, Alex

— Reply to this email directly or view it on GitHub https://github.com/gvalkov/jenkins-autojobs/issues/32.

gvalkov commented 9 years ago

Hello Alex,

Sorry for the delay. Since version 0.15.0 you should be able to use * in branches. For example:

branches:
   - file:///path/to/your/repo/*/
   - file:///path/to/your/repo/*/branches

The above will let you match all of the following in the refs section:

prjA/branches/*
prjB/branches/*
prjA/trunk
prjA/tags
prjB/trunk
prjB/tags

There is a lot of room for improvement. I sincerely hope to extend the functionality in a coming point release.

Please close the issue if this helps resolve your use case.

Kind regards, Georgi

lxndrhnz commented 9 years ago

Works great, thank you very much!