Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Command line interface

Andreas Reischuck edited this page Mar 23, 2014 · 8 revisions

disco command

The Rails Disco command line interface is executed with the executable disco followed by an command like this:

disco COMMAND

Following commands are available:

new

This command creates a new Rails Disco application.

disco new myapp

This will generate a Rails Disco application in the folder myapp.

If you want to extend an existing Rails application with Rails Disco features. You can run:

myapp/$ disco new .

server

disco server

Starts the domain server, the projection server and the Rails server. If you want to start them separately use disco domainserver and disco projectionserver. The Rails server gets started with the standard command rails server.
The projection server has an optional argument, where you can specify the amount of processes, which shall be used for the projections, e.g.:

disco projection 2

to use two processes. This can also be used when starting the whole stuff with disco server 2

generate

Similar as with Rails, Rails Disco provides generators to help you get started faster.
Syntax is like this:

disco generate GENERATOR ARGS

For more informations check the generator wiki page.

You can also use these generators with the rails command rails generate disco:...

rake

The Rake tasks help you manage the domain and projection databases.

rake disco:db:* SYSTEM=[projection/domain]

The db: namespace is copied from Rails and adds the option to run on the domain database as well. The domain will use the config/disco.yml domain_database-setting and adds _domain to all the files. For example schema.rb from Rails/projection will become schema_domain.rb for domain.

rake disco:domain:*

The domain namespace replicates the most important rails tasks for the domain.

rake disco:migrate:copy SYSTEM=[projection/domain]

This task copies the disco specific migrations into your application.

All the remaining tasks affect both: domain and projection database.

rake disco:drop          # drops domain and projection databases
rake disco:migrate:setup # This tasks works like db:setup, but will use migrations instead of the schema.
Clone this wiki locally