Content
tl;dr: The OpenProject installation has become much easier. Jump to the “The good news: Installing OpenProject is easy now” section to find out how much.
The current way to install OpenProject is difficult
OpenProject is a great project collaboration tool. We hear from many people who are really enthusiastic about it after they played with our demo pages.
Unfortunately, installing OpenProject has proven to be a pain. When reading through our support forums you can observe that pain. We know, it is hard to get the ruby stack running (choose the right ruby version, have all the dependencies installed, install gems, google for errors that tend to happen often) and our installation guides are very technical and provide tons of steps.
Great members of the OpenProject community (like Karol, or this other anonymous guy) contributed better guides. They are good guides, but still hard to follow for non tech-savvy people.
The good news: Installing OpenProject is easy now
Debian packages are the standard way to install software on Debian based Linux distributions. pkgr.io is a service that takes a rails (or node) application and packs it in a Debian package.
Using pkgr, installing OpenProject on Ubuntu 14.04 (64 bit) system has become pretty easy (given that you have a MySQL or Postgresql database at hand).
wget -qO - https://deb.pkgr.io/key | sudo apt-key add - echo "deb https://deb.pkgr.io/tessi/openproject trusty feature/pkgr" | sudo tee -a /etc/apt/sources.list.d/pkgr.list sudo apt-get update sudo apt-get install openproject sudo openproject config:set SECRET_TOKEN=$(sudo openproject run rake secret | tail -1) sudo openproject config:set DATABASE_URL=mysql2://user:pass@host:port/dbname sudo openproject run rake db:migrate sudo openproject run rake db:seed sudo openproject scale web=1 worker=1 sudo service openproject start
That’s it! Now, you have a running OpenProject at http://localhost:8080 (note: if you want to make OpenProject publicly available follow the instructions at the pkgr.io FAQ for instructions).
Have a look at the pkgr page for detailed installation and update instructions
Our way to a better installation experience
pkgr promises to be
The easiest way to get a debian package out of your Ruby or Node app
Well, let’s see if it can hold to this promise and let me show you the changes necessary to let OpenProject work with pkgr.io.
The first thing I noticed is that pkgr has a good documentation page. It is a lot to read, so let’s just start and follow the documentation while we’re working at the real thing.
First, I forked OpenProject from their GitHub repository opf/openproject
to tessi/openproject
and created a branch for our experiement named feature/pkgr
. The pkgr documentation tells us to create a" .pkgr.yml
":https://github.com/tessi/openproject/blob/feature/pkgr/.pkgr.yml file which we do:
user: openproject group: openproject before_precompile: ./packaging/debian/setup.sh
Note the before_precompile
. It is a pkgr.io hook that is run just before the asset precompilation starts at their build servers. Some rails apps (like OpenProject) need a running database for asset compilation, so we start a Postgresql server in packaging/debian/setup.sh
:
# we need postgresql for asset precompilation # see: https://pkgr.io/doc sudo service postgresql start
We run OpenProject with the unicorn webserver.
Trough a Procfile
we can define the processes being started to run OpenProject:
web: bundle exec unicorn worker: bundle exec rake jobs:work
Oh, and of course we need to add the unicorn
gem to our bundle. Therefore, we add the following Gemfile.local
:
ruby '2.1.1' group :production do gem 'rails_12factor' gem 'unicorn' end
Now we commit the changes (including Gemfile.local
which happens to be listed in .gitignore
) to the feature/pkgr
branch and continue at pkgr.io.
Here we sign in with our GitHub account, click the big green “Add new app” button, and select our repository. In the following settings page we can configure our app:
Now we can build debian packages!
What really surprised me in a positive way is that Cyril, the pkgr founder, found my changes and cared enough to help, he even added OpenProject to his showcase projects.
There are still some things left to be considered. For example, we need a good way to fully automate package building, to handle plugins, or to incorporate our latest angular-js changes.
This being said, we think that the Debian package installation is one step to a better installation experience and might become an officially supported installation method.
We’re happy to hear from your experiences with this new way to install OpenProject.