ows-delivery-history
====================

Records VECTOR deliveries for releases and masters.

## Getting Started

### Installation

The installation is very straightforward, but make sure you are using at least
python 3.4. If you use a Mac, you can install it using `brew`. If you use
Windows, just ask for a remote VM that has it installed for you.

```bash
$ cd ows-delivery-history
$ pyvenv env
(env) $ . env/bin/activate
(env) $ pip install -r requirements.txt
(env) $ pip install -r requirements-dev.txt
```

### Environment:
The following environment variables should be set:

Variable | Description                                    | Default
-------- |------------------------------------------------| -------
Environment | (dev, test, qa, prod)                          | dev
DB_USER | DB user name for delviery_history RDS instance |
DB_PASSWORD | DB password for delivery_history RDS isntance |
DB_HOST | DB host endpoint for delivery_history RDS instance |
DB_NAME | DB schema name for delivery_history RDS instance | delivery_history
SENTRY_DSN | DSN for Sentry service                         | -


### Permissions

In PROD and QA environments, to accept and authorize incoming and outgoing
requests, make sure you have the right DynamoDB permissions, as highlighted
in the corresponding [tech design](https://docs.google.com/document/d/1eHoI_BddTFMi15yCaHS6KvhSSoTrMEd3WwJINIpgNpM/edit).

### Running

When all dependencies have been installed, you can run the flask application
on your local instance by running:

```bash
(env) $ python dev.py
```

or

```bash
make dev
```

By using the development server, you will have access to specific features that
are not necessarily available in production, such as the exception tracer.

### Testing

To run the tests, all you have to do is to run:

```bash
(env) $ py.test tests/ --cov deliveryhistory --cov-report term-missing
(env) $ flake8 deliveryhistory/ tests/
```

or

To run tests: `make test`

To lint: `make lint`

### Updating

To install new dependencies.

```bash
(env) $ pip install -r requirements.txt
(env) $ pip install -r requirements-dev.txt
```

or

```bash
make pip_dev
```

### Notes

Windows users will not be able to use the `make` commands as Make is a Unix util.
Windows users can attempt to install [GNUWin](http://gnuwin32.sourceforge.net/packages/make.htm) to get this functionality.

