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

want to create a view for any new git branch and add a job to it #24

Open sandeepbalouria opened 9 years ago

sandeepbalouria commented 9 years ago

Hi ,

I have four jobs on jenkins. This is the behavior i am trying to achieve.

1> create a new view (name of the view should be the new git branch) for any new git branch. 2> add my four jenkins jobs using the jobs i already have as templates .

How should i do it. Examples of git-config.yaml would be appriciated

Thanks in advance

gvalkov commented 9 years ago

Hello,

I'm afraid jenkins-autojobs can only add jobs to views that already exist - it cannot create views by itself at the moment. However, it does actually make sense to have such functionality and I'll look into adding it in the coming week.

Could you elaborate a bit more on your second point? The way I understand it now is:

  1. You have four jobs - A, B, C and D.
  2. A new git branch is created - 'MyBranch'.
  3. The 'MyBranch' view is created if it didn't already exist.
  4. Jobs A, B, C, D are added to 'MyBranch'.
  5. A 'MyBranch' job is created from your template job and it is also added to the 'MyBranch' view.

I must be missing something?

Regards, Georgi

sandeepbalouria commented 9 years ago

Hi @gvalkov

  1. four jobs - A, B, C and D. These are jobs for for master branch for main git repo. These are separate jobs because they are building separate java modules with in this git repo.
    1. A new git branch is created - 'MyBranch'. view ==> MyBranch

3.The 'MyBranch' view is created if it didn't already exist. view ==> MyBranch

Jobs A, B, C, D are added to 'MyBranch'.

view ==> MyBranch four jobs ==> A-MyBranch, B-MyBranch, C-MyBranch, D-MyBranch These jobs are created using master jobs as templates

I hope This makes more sense.

thanks, Sandeep

sandeepbalouria commented 9 years ago

Hi @gvalkov

I just wanted to see if this makes sense.
Ideally we should have autojobs -

  1. create view(branch name) and add jobs to the view on a new git branch detection
  2. delete view and the jobs in it if the git branch is deleted

This is what i am trying to do :-)

Thanks