From 9c2ec2d42b7ad03f1f860063448e69a7fc0ee146 Mon Sep 17 00:00:00 2001 From: mprahl Date: Dec 21 2018 14:13:10 +0000 Subject: Add instructions on how to setup a dev environment using virtualenv and docker-compose --- diff --git a/docs/dev-guide.rst b/docs/dev-guide.rst index f0e63e9..9957dfe 100644 --- a/docs/dev-guide.rst +++ b/docs/dev-guide.rst @@ -66,8 +66,8 @@ You should run smoke test after deploying on stage: Docker Compose ============== -For development you may want to bring up quick instances of Greenwave / -WaiverDB / ResultsDB / all of the above. For more information on that see: +For local development, you may want to easily bring up containers of +WaiverDB, ResultsDB, and/or Greenwave. For more information on that, see: .. toctree:: :maxdepth: 2 diff --git a/docs/docker-compose.rst b/docs/docker-compose.rst index b65a4f9..9409b55 100644 --- a/docs/docker-compose.rst +++ b/docs/docker-compose.rst @@ -1,6 +1,47 @@ -Docker-compose for greenwave +Docker-compose for Greenwave =========================================== +virtualenv and docker-compose Quickstart +---------------------------------------- + +Start local development containers of ResultsDB and WaiverDB using +``docker-compose``. If you want the containers to run in the foreground, omit +the ``-d`` flag. + +.. code-block:: console + + $ sudo docker-compose -f docker/docker-compose.yml up -d resultsdb waiverdb + +Create a Python virtualenv: + +.. code-block:: console + + $ mkvirtualenv greenwave -p python3 + $ pip install -r requirements.txt + $ pip install -r dev-requirements.txt + +Create a local configuration file: + +.. code-block:: console + + $ cp conf/settings.py.example conf/settings.py + +Run the development server: + +.. code-block:: console + + $ DEV=true FLASK_ENV=development python3 run-dev-server.py + +You can run the unit tests, which live in the ``greenwave.tests`` package, with +the following command: + +.. code-block:: console + + $ pytest greenwave/tests/ + +The functional tests will not work this setup since they require ResultsDB, +WaiverDB, and Postgresql to be running locally. + Rationale ---------