0 Kudos
Don't
move!

I’ve been working with my team to create a new development and release process for our Moodle 2.x code.  We’ve been using SVN for a number of years, so we can save the SVN Vs. GIT argument until another date.  For now, this process is based on SVN.

We developed a new two-week release process, in which every two weeks we have a new production release.  This makes our turn around time for releasing new features, bug fixes and enhancements quite quick, or at least quicker than it used to be.  I’ve created a graphic to show how our process works but that can actually be more confusing than me just explaining how we do things.

Step 0: Create a trunk

mkdir trunk
svnadmin create trunk

Step 1: Add all your files to the trunk, commit trunk

# cd trunk and add files
svn ci -m "Initial Commit"

Step 2: Create your first branch – copy trunk to new branch

svn copy svn+ssh://[email protected]/path/to/svn/trunk svn+ssh://[email protected]/path/to/svn/branches/dev-1 -m "Initial Branch for dev-1"

Now you have a trunk which in this process we are going to use for production releases, and a dev branch which we are going to use for development

After all the development on the dev branch has finished, we do a code freeze so we can push the code to beta for testing.

Step 3: Code freeze, create new branch from trunk, merge changes
First checkout your trunk and dev-1 branch and update them, if you’ve done this then just update them with svn up and skip this checkout phase

svn co svn+ssh://[email protected]/path/to/svn/trunk .
svn co svn+ssh://[email protected]/path/to/svn/branches/dev-1 .

Create new dev-2 branch

svn copy svn+ssh://[email protected]/path/to/svn/trunk svn+ssh://[email protected]/path/to/svn/branches/dev-2 -m "Initial Branch for dev-2"

Merge dev-1 branch to dev-2

cd branches/dev-2
svn merge svn+ssh://[email protected]/path/to/svn/branches/dev-1
svn ci -m "Merging changes from dev-1 to dev-2"

Resolve any conflicts

Now release your code from trunk to your beta server and test test test.

NOTE: It’s important to create your branches from trunk or else you might run into conflicts because the revision numbers won’t match

Step 4: Production release day, merge all changes and release

First checkout your trunk and dev-1 branch and update them, if you’ve done this then just update them with svn up and skip this checkout phase

svn co svn+ssh://[email protected]/path/to/svn/trunk .
svn co svn+ssh://[email protected]/path/to/svn/branches/dev-1 .
cd trunk
svn merge svn+ssh://[email protected]/path/to/svn/branches/dev-1
svn ci -m "Merging changes from dev-1 to trunk"

Resolve any conflicts

cd branches/dev-2
svn merge svn+ssh://[email protected]/path/to/svn/branches/dev-1
svn ci -m "Merging changes from dev-1 to dev-2"

Resolve any conflicts

Now you can release trunk to production.

Here is the confusing diagram that I have created for our two week SVN release/development process.

NOTE: I want to make it clear that this process is by no means the only way to do this, nor is it the best.  Please leave comments if you have any questions or just want to discuss this further.