Installing Redmine 3.0.1 on Openshift

Posted in software by Christopher R. Wirz on Wed Jan 13 2016

Redmine is a great tool for project management. While the source code is free, there are a limited number of options for hosting it affordably. Luckily, Openshift has a reasonable free tier that can support an instance of Redmine.

The following procedure will create a redmine instance - and was the procedure used to create this repo after a successful deployment. The Openshift application must be configured as follows:

  • Ruby 1.9 or 2.0 (no scaling)
  • MySql 5.1
Begin the installation by navigating to the app runtime directory.

    
cd ~/app-root/runtime/repo/
    

Download Redmine.

    
wget http://www.redmine.org/releases/redmine-3.0.1.tar.gz
tar xvzf redmine-3.0.1.tar.gz
rm redmine-3.0.1.tar.gz
    

Extract it to its new environment.

    
rm -rf public
rm -rf tmp
mv redmine-3.0.1/* ~/app-root/runtime/repo/
rm -rf redmine-3.0.1*
    

Make sure rails is installed.

    
gem install rails -v '4.2.1'
gem install bundler -no-ri -no-rdoc
gem install mysql2 -v '0.3.18'
    

Get the configuration files.

    
cd ~/app-root/runtime/repo/config
wget —no-check-certificate https://raw.githubusercontent.com/chriswirz/openshift-redmine-3.0.1-quickstart/master/config/database.yml
wget —no-check-certificate https://raw.githubusercontent.com/chriswirz/openshift-redmine-3.0.1-quickstart/master/config/configuration.yml
cd ~/app-root/runtime/repo/
    

bundle install

    
bundle install --no-deployment
    

Populate the database.

    
rake generate_secret_token
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
    

Restart the app/gear.

    
gear stop
gear start
    

Once the gear is functioning properly, add the contents to the the repository. You must have the gear's ssh key added to your remote repository's (or application's) allowed key collection. Here is how to do that:

    
git config --global user.name "you"
git config --global user.email "you@email.com"
ssh-keygen -t rsa -C "you@email.com"
cat ~/.ssh/id_rsa.pub
    

Now that the SSH key is added, you can push the code to a repo. This example just shows you how to push to your gear's repo, but I have also tested this with github.

    
cd ~/app-root/runtime/repo/
git init
git add .
git commit -m 'Openshift Quickstart for Redmine 3.0.1'
git remote add origin "ssh://$OPENSHIFT_APP_UUID@$OPENSHIFT_APP_DNS/~/git/$OPENSHIFT_GEAR_NAME.git/"
git push -u origin master
     

And that's it! You should be able to go to the url of your application and have a fully functional instance of Redmine.