In the last few weeks I have tried to work out a suitable development and release workflow for the Sigimera project. For me it was important to have an easy overview about the deployed versions, without the need of intense ChangeLog writing or manual tracking of the versions.
This requirement is a must for bigger teams, but also useful for small teams and even for single developers.
SCM with GIT
1. Develop always in a separate branch, e.g. develop
This keeps the master branch clean and stable. You have always a working version that could be used for demonstration purposes, but also for manual/automatic deployment.
2. Never commit directly into the master branch.
All changes should be merge from the develop branch.
3. Merge always with –no-ff (no fast forwarding).
This allows the easy tracking of changes. You get a ChangeLog for free if you take all commits between two merge statements. As side effect you can automatically extract this ChangeLog. Look at the output at github or bitbucket, it looks really nice. You see there immediately the new changes.
4. If you plan to deploy (release) a version, merge the changes from the develop branch into the master branch and create a tag of the newly created merge commit.
You are able to see the changes with the help of the merge commit message, but the creation of an additional tag shows additional the version number of the deployed version.
Workflow Enforcement
In my opinion the team working on a software project should accept the workflow. Otherwise you should consider to adapt it or you will fail. But we are all human make mistakes, specially in the beginning. For example if somebody commits to the master branch it breaks the ChangeLog mechanism and maybe the public version. That means we have to assure that only senior developers or a special deployment team have the needed rights to change the master branch and deploy the current version.
Gitolite
Gitolite
is nice way to have a permission model on a branch base. Currently I use the following configuration file that allows only the deployment team to update the master branch and add/delete tags. The main developers work on the develop branch. Other needed branches, such as new_feature can not pushed to the remote repository. This keeps it clean, but allows the developers to work locally on as much branches they like.
|
1 2 3 4 5 6 7 |
repo @repositories
RW master = @deployment
RW develop = @dev
R master = @all
- master = @all
RW = @deployment
RW+ = @admins |
As you can see in the gitolite configuration file only the admins group can rewind commits. The reason for this is that we want to be able to track all changes.
Continuous Integration
The continuous integration uses always the develop branch. This is enough, because the master branch takes all changes from the develop branch. This implies that if the develop branch succeeds, also the master branch must succeed.
Deployment
The deployment process uses always the master branch, doesn’t matter in which branch you are.
Currently the deployment works only for the Ruby on Rails part of the project. For this purpose Capistrano
is used. Important for this step is that the deployment team shares the same user, but with different SSH-Keys. I have called this user deploy. On the server side the Ruby Version Manager (RVM)
assure that the deploy user is able to install the needed dependencies.
The deployed version
If you develop and deploy an internal software, such as our Sigimera Admin Interface, you can integrate the ChangeLog directly into the application. The nice thing of that approach is that the commit messages can be linked directly to the source code repository, e.g. to github or bitbucket.
Outcome
The here presented approach is used currently in the Sigimera project, but was also adapted to other, independent projects on which I am currently working on. If you want more in depth information, please feel free to contact me.














