1

All-

I've been using Jenkins for about a year and now I'm trying to setup a continuous delivery pipeline for my team and have a question.


Question

Is it possible to have Jenkins checkout/compile/test code from one SVN branch, then, if everything passes, push that code into another SVN branch?


For my team, I'm envisioning the following branches ::

-Our Product Root
  -Individual Issue Branches
    -Issue1
    -Issue2
    -Issue3
  -Integration Branch
  -Stable Branch
  -Production Branch

Each Individual Issue Branch will be a copy of the Stable Branch

but

the commits for the Individual Issue Branches will go to the Integration Branch.


I would like Jenkins to::

  1. Listen for commits against Integration Branch in SVN
  2. Download Integration Branch from SVN
  3. Compile Integration Branch code
  4. Run any unit tests
  5. If everything passes, commit the new code to the Stable Branch

So, can Jenkins checkout/compile/test code from one SVN branch and upon success, commit that code to another SVN branch?

Thank you for your time,

Jeff

Chiefwarpaint
  • 553
  • 1
  • 11
  • 23

3 Answers3

1

Its depends one your build technology. there are many ways to achieve this. 1) post build steps-execute shell

 svn commit --file file1 file2

This files you can get from SVN change request.

2)Use SVN Publisher Plugin

https://wiki.jenkins-ci.org/display/JENKINS/SVN+Publisher

3)incase you are using SVN with ant http://subclipse.tigris.org/svnant/svntask.html

more info :

Commit file from Jenkins workspace to SVN

Community
  • 1
  • 1
DevD
  • 565
  • 4
  • 15
0

Yes this is possible, but not native to Jenkins itself... unless (you guessed it) there is a plugin that does this.

How I would accomplish this is via a script that after a successful build would check out this second branch to a new dir, then copy whatever you need into that working dir, then check in that new branch.

Seems wasteful to me, so there is probably room for efficiency gains, especially in the check out of other branch. SVN isn't my strength, so I'm assuming you have to first check out a branch to a location, make some changes, then check in to that branch. I don't know if there is a way to check in a currently checked out branch to another branch AND be able to automatically handle any conflicts that might come up.

0

I ended up using the Subversion Merge Plugin. Basically, I just created a parent Jenkins job that monitors my Stable branch and set it to allow feature branching using the plugin.

From there, you can use the plugin to auto-create feature branches. This allows you to code on individual feature branches. Then when you're certain your code is good to go, you can use the plugins' built-in "Integrate to Upstream" functionality to get your code merged up into your Stable (trunk) code.

Chiefwarpaint
  • 553
  • 1
  • 11
  • 23