0

New Subversion development environment

ColdFusion
The development team that I am working with originally started out as two developers. We had about 4 applications between us and rarely were we working on the same application, much less the same piece of code. We simply mapped our development IDEs to a mapped drive on the development server and worked on what we needed to. When a piece of code was ready it would be moved to a staging server to be tested, then moved to production. If for some reason we were working in the same area, we would just shout over the wall and warn the other. Sound familiar? If you are on a small team, I am betting it does.
As our development team has grown we have definitely found a number of weaknesses with this approach, including:
  • Accidentally overwriting another developer's work, or worse... having *yours* overwritten!
  • Lack of a clear trail of historical changes. Yes, of course we are all supposed to sufficiently comment all changes, but in reality we all know that this occasionally fails to happen.
  • Lack of trail of ownership. (see "commenting" above)
  • By pushing up one file at a time both to staging and then to production, we found that over time we had some variances between what was on the production server as opposed to what was in staging, and often a vast difference from what was in development.
  • No easy way to roll back to a previous state of the application.

This has been one of those growing problems where we knew we needed to implement source control, but in the heat of development, when on earth would we ever find spare time to do this? We finally decided it was time to make time.

The following is the approach that we took, and has worked really well for us so far. For the purposes of this document, we will be calling the applications app1.domain.com, app2.domain.com, app3.domain.com, and app4.domain.com.

We first altered our web server so that each developer has their own development environment, including their own instance of ColdFusion, a directory structure completely separated from the others, and their own databases mirroring the production databases (eg. app1database is named dave-app1database). So, now our development directory on the server looks like this:

-aaron/CustomTags/ (each developer has their own copy of the global custom tags directory)
-aaron/app1.domain.com/
-aaron/app2.domain.com/
-aaron/app3.domain.com/
-aaron/app4.domain.com/
-dave/CustomTags/ (each developer has their own copy of the global custom tags directory)
-dave/app1.domain.com/
-dave/app2.domain.com/
-dave/app3.domain.com/
-dave/app4.domain.com/
[repeat with other developers]

Given this model, when I am testing the code I am writing for app1.domain.com, I can access it in the browser by going to http://dave.app1.domain.com

Next we installed Subversion on the development server and imported the current production code as individual projects (CustomTags, app1.domain.com, app2.domain.com, app3.domain.com, app4.domain.com).

The Development Process:
Now that we have the model in place, anytime that a developer is assigned to work on a project they simply check out the code for that application. When they are ready to submit back to the repository, they first need to synchronize with the repository to see if anyone else has modified any code in the project. If so, they need to update their development instance with those changes and retest to make sure that their changes play nice with any other changes. Assuming all tests are fine, they can then commit to subversion and notify the project manager. In the event of a conflict where another developer has committed changes to a file that they are working with since checkout time, Subversion makes it easy to compare the changes and merge the two versions gracefully.

The Deployment Process:
Once changes have been committed the project manager archives current staging code, and replaces it with a Subversion export from the repository. By taking the approach of moving code the application as a whole unit,rather than the piecemeal approach of moving whatever files we have changed, we are eliminating the potential for accidentally forgetting to move any changed files, thereby keeping the application in tact. Once the staging environment has been completely tested, the same approach is then taken to move the code to production.

We are now about 2 weeks into this environment and all is going well... except the following scenario. What if you aren't ready to move *all* the changes yet? Stay tuned for another entry soon on branching projects.

tags:
ColdFusion
best student consolidation loan said:
 
<A href="http://studentloadconsolidation.blogspot.com" >Best Consolidation Loan Student </A> | <A href="http://dui--dwi-lawyer.blogspot.com">New Mexico DWI Law</A> | <A href="http://dwijerseylawyernew.blogspot.com" 0>New Jersey Dwi Attorney</A>
 
posted 671 days ago
Add Comment Reply to: this comment OR this thread
 
KEVIN BENORE said:
 
I understand the environment you have setup and was looking to implement something for our company as well. I want to make the transition as easy as possible for our development team, so I can eliminate any possible resistance. In our environment we have a production server web server (Windows 2003 & IIS), a production SQL (MS SQL 2005) server, a test server with both web and SQL, and a subversion server (FREE BSD).

Developer environment. What we would like to do is allow testing to go on our testing server. Perhaps multiple developer directories is the way to go ... however we do like to model the test server's code exactly like the development server, so when we have physical paths (c:\whatever\), we don't have to change them. Most of our new code keeps those paths in the DB but legacy code sucks. Suggestions?

Subversion environment. Is there an easier way to push the files to our production server or should we just develop some sort of release schedule and deal with it. It would be nice that once the code was "committed" to subverion, it would automatically show up on production. (Or is that wishful thinking?) Suggestions?

Let me know what you think would be a good environment for us. We have the thing setup, but we need to start using it now!
 
posted 618 days ago
Add Comment Reply to: this comment OR this thread
 
 
Kevin, we try pretty diligently to keep implementation-specific stuff out of our code/database such as server paths, but I understand your point about legacy code. We actually go so far as to have a seperate ColdFusion instance for each developer, and a seperate database for each. Then in each CF instance we name the DSN the same as the other developers and each one points to that particular developers database. It really helps keep us from smashing other people's toes. I would probably recommend that approach.

As for auto deployment, we tend to do the releases manually so as to provide tight controls, but there are auto solutions available. You might want to look into writing ANT scripts that do what you are asking on commit.

For us, it works like this:
When a developer completes an item and it is tested within their environment, they commit it into Subversion. At that time, the release coordinator (lead deverloper or whoever) does an export from Subversion to a staging instance which completely mirrors production. When that is tested sufficiently that code will replace the current production code.

I am sure there are other sound approaches out there, but that system works pretty dang well for us.
 
posted 618 days ago
Add Comment Reply to: this comment OR this thread
 
KEVIN BENORE said:
 
Thanks, I will run this by our team and get input.
 
posted 618 days ago
Add Comment Reply to: this comment OR this thread
 
KEVIN BENO said:
 
 
posted 479 days ago
Add Comment Reply to: this comment OR this thread
 
KEVIN BENORE said:
 
Well, I finally figured out why your name was so familiar at the DFWCFUG meeting! We still haven't implemented subversion yet, but we have since added two developers (we now have 4 full developers and 1 quasi developer). We are planning to implement your suggested solution this month. But now I can rest easy remembering why I remember your name!
 
posted 479 days ago
Add Comment Reply to: this comment OR this thread
 
 
lol.... yup, that's me. I also was the only guy on the conference call with you for cfopenbb that almost..... 2 years ago?!?!

~d
 
posted 479 days ago
Add Comment Reply to: this comment OR this thread
 
KEVIN BENORE said:
 
Oh wow! Talk about trying to start something that never took off. And poor Matt inherited the project, but I think his plate is so fool. I hear him threaten to release it on his podcast every so often though. :)
 
posted 479 days ago
Add Comment Reply to: this comment OR this thread
 
Kevin Benore said:
 
fool = full. Oops. :)
 
posted 479 days ago
Add Comment Reply to: this comment OR this thread
 
Mike Henke said:
 
Update on how the Subversion development environment is working :-) New blog entry :-)
 
posted 363 days ago
Add Comment Reply to: this comment OR this thread
 
 
Honestly Mike, I have reached the point of "how the heck did we do things before SVN?!?!". We make heavy use of it both in my full-time job and in my moonlighting work with my partner Aaron, primarily for the InstantSpot code base.

For the InstantSpot stuff, we just have the SVN repo on a dumb server for checking in/out and run the application locally on our laptops. I can't imagine another product matching it/beating it when it comes to graceful source control and managing merging of conflicts, etc. I am a firm believer. Do yourself the favor and take the time to set it up. If you are a windows guy they make it embarrassingly easy with the svn-1-click install. For us Linux peeps it is a bit more work, but certainly worth it.
 
posted 363 days ago
Add Comment Reply to: this comment OR this thread
 

Search

Dave Shuck for President!