-
Notifications
You must be signed in to change notification settings - Fork 0
Startup Instructions (Windows)
Melelelelelelelel edited this page Nov 6, 2018
·
5 revisions
Note this page may be incomplete as I don't need to use Travis/pre-commit/etc. since I'm not dev-ing
You will need to install the following:
- Download & install Python 3.6
- From Terminal, make sure you have Python version 3.6 by running
python --version
- Download & install Git
- You may also want the GitHub GUI
- Make a Docker account (you'll need it to install Docker)
- Download & install Docker (note there's an option to use Windows or Linux containers (default), I used Linux and it seems to work fine)
- Run through the Docker tutorial (up to and including the Hello World portion)
- Clone the Git repository to your machine
- Install pipenv
- From the project directory, use Docker to build the project Dockerfile using the command
docker build -t irs_db .
- Use Docker to run the container you just created using the command
docker run --rm -p 5432:5432 irs_db
- Make a new Terminal and navigate to the project directory, then use pipenv to run pytest (see pipenv link above). This should cause changes in the container window as well
- If you need to use a local DB, open up a new terminal in the project directory and run
psql -U postgres -c "DROP DATABASE irs"
thenpsql -U postgres -c "CREATE DATABASE irs OWNER postgres"
- Run
psql -U postgres irs < db/schema.sql
andpsql -U postgres irs < db/test.sql
- To use the DB with Flask, run
psql -U postgres -h localhost -p 5432 < db/test.sql
Note that if you CTRL+C out of the Docker container, the process will still be running in the background. Using docker ps
will show you if there is anything still running.
If a project container (eg. irs_db) is still running, you will be unable to run another container for this project (I think) until you stop it using docker stop [container id]
where the container id is the one associated with the container to stop (use docker ps
to find it).
- Navigate to the project directory and, from the pipenv shell, set the FLASK_APP environment variable using
set FLASK_APP=web
- Make sure Docker is running the project container (I believe irs_db, though postgres seemed to work too), then run flask using
flask run
- In your browser, go to the test site