Porting the Gitorious installer from supporting only RedHat/Centos to support Ubuntu/Debian

November 19, 2013

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

  1. Lessons learned and things to keep in mind when porting such installers or building new ones are:
  2. Do everything you can in Puppet. The less you have to do in bash/bourne shell the easier it is to port you code.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. Don’t try to install gitorious on a server already running apache.

Code samples

The following is a sample of multiple package install and config directories for different operating systems and dependencies in Puppet:
https://gist.github.com/jalli/7603178

Here you can see the bash signal handler for cleaning up:
https://gist.github.com/jalli/7603244

Bash exit on failure of command:
https://gist.github.com/jalli/7603277

Bash Figure out which OS we are running on:
https://gist.github.com/jalli/7603300

About The Guest Blogger:

Jarl

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.

Previous Article
Your Guide to Getting Started with Mobile Application Assessments
Your Guide to Getting Started with Mobile Application Assessments

Many organizations already have some form of mobile presence or plans to deploy one in the near future but ...

Next Article
Business Logic Pitfalls in Trading Applications (Blog Series) — 1
Business Logic Pitfalls in Trading Applications (Blog Series) — 1

Business logic vulnerabilities have always been the elusive unicorn of the application security world that ...

×

Schedule a live demo

First Name
Last Name
Company Name
!
Thank you!
Error - something went wrong!