Home Wiki > openSUSE:Build Service Webclient Development
Sign up | Login

openSUSE:Build Service Webclient Development

tagline: From openSUSE


The web interface of the openSUSE Build Service (OBS) at http://build.opensuse.org is written with Ruby on Rails. It communicates with the Build Service API via XML over HTTP. So you can easily setup a local instance of the web interface that uses the API server at http://api.opensuse.org. Just checkout the sources, install the ruby on rails packages and you are ready to run and develop the webclient.

Install

Installing the needed packages for your openSUSE release can be done as root user (please replace 12.1 with your version):

zypper addrepo -f obs://OBS:Server:Unstable/openSUSE_13.1 obs
zypper install obs-server obs-api

Even though you may not use the obs rpms, they will pull all necessary dependencies. The sources of the OBS are hosted in a git repository at GitHub. Getting the source code is easy just by anonymous checkout (Please also read the obs git page):

git clone git://github.com/openSUSE/open-build-service.git
cd open-build-service

To fetch some shared modules please call:

git submodule init
git submodule update

Create the database configuration by using the example configuration (and edit as needed):

cd src/api
cp config/database.yml.example config/database.yml

Also, create the config options by using the example file (edit as needed):

cp config/options.yml.example config/options.yml

Make sure you have all gems needed:

zypper in ruby-devel gcc-c++
cd open-build-service/src/api
bundle install

Next, create the database that is used for caching data and user sessions:

cd open-build-service/src/api
rake db:setup
rake db:fixtures:load

To regularly update to the latest code run:

git submodule update
git pull origin master

in the build-service/ directory and update the database via.

cd build-service/src/webui
rake db:migrate

Start your local web ui

Running the web interface is really easy now just by running

cd open-build-service/src/api
RAILS_ENV=development ./script/start_test_backend &
rails s

This starts a local instance where you can connect with any web browser using http://127.0.0.1:3000/ as URL. So there is no need to install a full build service, no database administration, just checkout and run it :) You can easily edit files esp. below the app/ directory and customize or improve the web interface for your needs.

To make use of caching there needs to be a running memcached daemon. It can be started with:

sudo /etc/init.d/memcached start

Debugging

To debug the rails app, you'll need the ruby debugging packages installed:

zypper install rubygem-ruby-debug

After that, you can set breakpoints in the code by adding a line that contains "debugger".

To start running the server in debugging mode, do

./server --debugger

Contributing

Github has a very easy mechanism of contributing to projects. Just go to http://github.com/openSUSE/open-build-service, login and click on 'Fork'.

After committing your changes to your clone of the OBS repo, you can request to merge them into the main repository by clicking on 'Request merge', and selecting the build-service target repository. The OBS team will get notified then and review your patch.

To get in contact with the OBS community, you can use our opensuse-buildservice mailing list (archive) or join the #openSUSE-buildservice channel on freenode.