Source

cheesecake-service / INSTALL

Requirements
------------

* Python >= 2.4 (http://www.python.org/)
* Postgres database (http://www.postgresql.org/)
* Python module psycopg 1.1 (http://initd.org/projects/psycopg1/)
* Cheetah templates (http://www.cheetahtemplate.org/)


Installation process
--------------------

Create "cheesecake" system user::

  # useradd cheesecake

Create "cheesecake" user for Postgres::

  # su postgres
  $ createuser cheesecake
  ^D

Create "cheesecake" database::

  # su cheesecake
  $ createdb cheesecake

Use database_schema.sql to create tables::

  $ psql
  cheesecake=> \i database_schema.sql

Unit tests use "cheesecake_test" database, so if you want to run them repeat
last two steps for "cheesecake_test" database.


Clearing Cheesecake service data
--------------------------------

When you want Cheesecake service to "forgot" all past scores and runs, do this
four simple steps.

1. First of all, stop the cheesecake_daemon.
2. Now you can clear the database::

   $ cd ..cheesecake_service_directory.. # use appropriate path
   $ python contrib/clean_database.py

3. Then clean the logs directory (pointed by LOG_DIRECTORY variable in config.py).
4. Lastly, set TIMESTAMP_FILE (defined in config.py again) modification time to
   some fixed date (probably August 10th like the last time) by "touch -d".

After this steps Cheesecake service can be enabled again.

Running tests
-------------

To run set of unit tests execute::

    $ nosetests -v --with-doctest --doctest-tests --exe -a \!functional

To run functional tests (which need existing and running "cheesecake_test" database)::

    $ nosetests -v --exe -a functional