As our company grows we have started experiencing some pain points with using bare git repositories for our revision control. Compared to GitHub the following are the features that are most missed:
- Graphical branch views
- Access control and access via git/https protocols
- Merge/Pull requests
- Activity tracking
We also wanted full LDAP integration for authentication and authorization, which Gitorious provides. Installing Gitorious is notoriously hard and to mitigate this, the Gitorious team has created a shell/puppet based installer. Unfortunately this installer was only made for RedHat/Centos based linux systems. All the accessible guides for how to install on Ubuntu/Debian based systems are out of date and inaccurate to the point of doing more harm than good.
As a result, we decided to convert the installer to work on both Redhat/Centos based platforms and Ubuntu/Debian platforms with the capability to expand to any Linux distribution. The new installer can be found at the following location, to install follow the guide at: http://getgitorious.com/installer. However, you will need to use the following git repository instead of the official one: https://github.com/jalli/gitorious_ce_installer_ubuntu
- Lessons learned and things to keep in mind when porting such installers or building new ones are:
- Do everything you can in Puppet. The less you have to do in bash/bourne shell the easier it is to port you code.
- Re-use existing puppet modules. Don’t write your own. If you need to customize then fork an existing module and keep it in a separate repository for the ability to pull updates from upstream and give upstream the ability to pull your changes.
- Ruby packaging and gem is fickle. Specific versions of rails depend on specific gem packages that are only available when using old versions of rubygems.
- Always keep it failsafe. If anything unexpected happens it’s better to exit immediately with an error than to try to continue, the people installing will thank you. Your installer should also roll back any changes it has done, preferably with a signal handler.
- Running the installer again should not break anything. It should be possible to run a partial install and then resume by running the installer again.
- Don’t try to install gitorious on a server already running apache.
The following is a sample of multiple package install and config directories for different operating systems and dependencies in Puppet:
Here you can see the bash signal handler for cleaning up:
Bash exit on failure of command:
Bash Figure out which OS we are running on:
About The Guest Blogger:
Jarl has more than 15 years of experience in designing, building and operating enterprise IT systems with extensive experience in software, networking, security and databases.
Over the course of his career he has consulted for both large and small international corporations working within the software industry and is a serial entrepreneur with several startups under his belt.
A jack of all trades, a systems administrator by day and a developer by night.