LandRegistry/cases-alpha

Name: cases-alpha

Owner: HM Land Registry

Description: The service to handles cases. Cases refers to any request for change on a title, or other requests for action for a title, it can be a search.

Created: 2014-09-03 14:12:08.0

Updated: 2015-01-28 07:40:03.0

Pushed: 2014-12-19 17:38:24.0

Homepage: null

Size: 6116

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

cases

Build Status

Coverage Status

The service to handles cases. Cases refers to an application and the relevant documentation lodged at Land Registry to be processed (such as 'register a charge') from a citizen/conveyancer

Getting started
clone git@github.com:LandRegistry/cases.git
ases
Run tests
intall -r test_requirements.txt

Then run:

est
Environment variables needed
INGS
BASE_URL
SION_URL
_URL

Local development config:

rt SETTINGS='config.DevelopmentConfig'
rt DATABASE_URL='postgresql://localhost/cases'
rt DECISION_URL='http://decision.landregistry.local'
rt MINT_URL='http://mint.landregistry.local'

Note in local dev port is assigned by dev env scripts, so in production assign a port.

For production

=[SOME NUMBER]
INGS='config.Config'
rt DATABASE_URL='postgresql://user:password@db_host:port:db_name'
rt DECISION_URL='http://decision_host'
rt MINT_URL='http://mint_host'
Create/Update database

There's an intial migration script in the project created using Flask-Migrate so you just need to call the following

on manage.py db upgrade

On heroku run this

ku run python manage.py db upgrade --app lr-cases

Run the upgrade command whenever you have additional migrations

Run the app

Run in dev mode to enable app reloading

run-app

Run tests

run-unit-tests

This app runs on PORT 8014

Create Debian package
ackaging
ild.sh

This will create a virtualenv, install cases into that env. Then it will set virtualenv paths to match the eventual installation directory of the debian package that is the output of build.sh.

Note The packaging of a virtualenv using fpm may soon be much easier depending on outcome of this

The result of running ./build.sh is debian package will be created in packaging called cases. The package has a basic upstart config, empty pre and post install and remove scripts. For the moment the installer is set to install to /opt/alpha/cases. Change as required. Also post install does not set ownership or permissions on the installed package.

The deb package also contains the two runnable worker processes that process pending and approved changes. There are upstart configs for both of the worker processes.

Before installing in a production box you should:

To install the debian package
 dpkg -i cases_0.1_all.deb

Then run

 start cases
 start pending-cases
 start process-cases

Note that this assumes you have set all the correct environment variables.

To uninstall

 dpkg -r cases
Database migrations

At the moment the migration version files and manage.py are included in packages and live in installation directory. I would for the moment run these after the install (and under control of configuration management tool) before running the service.

opt/alpha/cases
on manage.py db upgrade

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.