maven - How to configure a single Jenkins job to make the release process from trunk or branches? -


i enhancing release process of our projects on jenkins (1.430).

current release jobs

today, 1 specific project, have 1 job dedicated release process. complete procedure following:

  1. the developer in charge of release changes manually version of pom.xml files (in fact using mvn versions:set -dnewversion=2.0) rid of -snapshot.
  2. then, creates tag in svn (http://my-svn-repo/project/tags/v_2_0 example).
  3. once tag has been created, logs on our jenkins server, , starts release build.
  4. this build ask him tag wants use build. job configured parameterized build, parameter list subversion tags.
  5. jenkins build artifacts tag, , deploy them on our nexus instance.
  6. once done, developer set pom.xml versions new development version (i.e. 2.1-snapshot).

the advantage of method have jenkins job, build rely on tag.

however, procedure involves many human interventiosns (changes of pom.xml, commits, tags, etc.).

new release jobs

now, use maven release plugin. i've created job asks 3 information user launches build:

  • the version of release (parameter releaseversion of release plugin);
  • the version of development, after release (parameter developmentversion of release plugin);
  • the name of tag (parameter tag of release plugin).

this job works fine, except 1 point: job based on trunk or on branch in svn. means if have 2 branches (in addition trunk), need create 3 release jobs: 1 per branch.

one idea keep best of 2 worlds (i.e. using mvn release, keeping 1 release job) add build parameter ask user path of trunk / branch. instead of setting http://my-svn-repo/project/trunk (or http://my-svn-repo/project/branches/branch_v1) in job configuration, set http://my-svn-repo/project/$from_branch, , ask user input from_branch parameter.

the problem solution user have input either trunk or branches/branch_vx, may lead errors.

ideally, love have build parameter let me choice of branch (including trunk), parameter list subversion tags exist choice of tags...

so question: there better way configure one jenkins job can work on branches?

thanks.


edit: found validating string jenkins plugin can interesting ensure value defined user respects regular expression. helpful in case...

you need version 1.32 of subversion plugin. issue jenkins-10678 implemented in version.

then give project url (which needs contain trunk, branches, , tags) , offer trunk branches.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -