This is the server application for Backbeat, the open-source workflow service by Groupon. For more information on what Backbeat is, and documentation for using Backbeat, see the wiki.
The docker build will create a user based on the BACKBEAT_USER_ID
and BACKBEAT_CLIENT_URL
environment variables set in the backbeat_user.env
file. Change these as necessary.
Move the backbeat_user.env.example
file into place:
$ mv docker/backbeat_user.env.example docker/backbeat_user.env
Start the server(starts web workers and sidekiq workers):
$ docker-compose build
$ docker-compose -f docker/docker-compose.local.yml up
Run a backbeat console:
$ bin/docker_console
- Clone the repo:
$ git clone git@github.com:groupon/backbeat.git
- Install a Ruby version manager if necessary:
- Install any of the supported Ruby versions:
- JRuby 1.7.3 - 1.7.20
- MRI 2.0.0 - 2.3.0
- Install Bundler if necessary:
$ gem install bundler
- Open up the project:
$ cd backbeat
- Install the necessary gems:
$ bundle install
-
Install Postgres or use an existing Postgres db
-
We recommend postgresql-9.4 but Backbeat currently supports any postgres version that allows the uuid-ossp extension
-
Install on Mac OS
$ brew install postgres
-
-
Create backbeat role in postgres DB with your postgres user (postgres in this example)
$ sudo su postgres -c "psql -c \"CREATE ROLE backbeat with SUPERUSER LOGIN PASSWORD 'backbeat'\";"
$ psql -d postgres
# CREATE ROLE backbeat with SUPERUSER LOGIN PASSWORD 'backbeat';
> CREATE ROLE
- Note you can change your db configs to what ever you'd like in config/database.yml. The above command allows for the default values in the .yml
- Note, on Lion+ you may already have a postgres user,
_postgres
. - Note, you might not be able to get this working, so try Postgres.app.
- Create the database
$ bundle exec rake db:create
- Run the database migrations using the following
$ bundle exec rake db:migrate
- Open backbeat server console and you have access to the db
$ bundle exec rake console
Workflow.last # should return nil
- Install Redis or use an existing Redis instance
-
Redis is used for processing of asynchronous and scheduled jobs with Sidekiq
-
Install on Mac OS
$ brew install redis
- Start Web Server and Workers
- For testing you can run these as daemons or in different terminal windows
- For production you will want to use some sort of monitoring on these processes.
- See the Procfile for a summary of the processes
$ foreman start
Running the tests:
$ RACK_ENV=test rake db:create db:migrate
$ rspec
Run the migrations:
$ rake db:create db:migrate
Open a console:
$ rake console
Start the server:
$ rackup
Start the sidekiq workers:
$ bin/sidekiq