remove -U and -h flags, export vars instead

This commit is contained in:
Ed Chalstrey 2022-02-23 12:31:06 +00:00
parent 3d37853201
commit ee613e8a3a

View File

@ -166,6 +166,8 @@ Set the `<pgpassword>` as an environment variable.
```bash ```bash
export PGPASSWORD=<pgpassword> export PGPASSWORD=<pgpassword>
export PGUSER=<username>
export PGHOST=localhost
``` ```
Create a colouring london database if none exists. The name (`<colouringlondondb>`) is arbitrary. Create a colouring london database if none exists. The name (`<colouringlondondb>`) is arbitrary.
@ -177,7 +179,7 @@ sudo -u postgres psql -c "SELECT 1 FROM pg_database WHERE datname = '<colouringl
Run `psql` interactively. Run `psql` interactively.
```bash ```bash
psql -d <colouringlondondb> -U <username> -h localhost psql -d <colouringlondondb>
``` ```
In `psql`, necessary postgres extensions. In `psql`, necessary postgres extensions.
@ -230,7 +232,7 @@ You should then download the file to the machine where you are setting up your d
In your Ubuntu installation where you have been running these setup steps (e.g. Virtualbox VM), you can then recrate the db like so. In your Ubuntu installation where you have been running these setup steps (e.g. Virtualbox VM), you can then recrate the db like so.
```bash ```bash
psql -d <colouringlondondb> -U <username> -h localhost < <dumpfile> psql -d <colouringlondondb> < <dumpfile>
``` ```
</details> </details>
@ -288,7 +290,7 @@ To help test the Colouring London application, `get_test_polygons.py` will attem
First open `colouring-london/etl/load_geometries.sh` and `colouring-london/etl/create_building_records.sh` and add this `-d` flag to all the `psql` statements present (two in the former, one in the latter): First open `colouring-london/etl/load_geometries.sh` and `colouring-london/etl/create_building_records.sh` and add this `-d` flag to all the `psql` statements present (two in the former, one in the latter):
```bash ```bash
-d <colouringlondondb> -U <username> -h localhost -d <colouringlondondb>
``` ```
Download the test data. Download the test data.
@ -322,7 +324,7 @@ Now run all 'up' migrations to create tables, data types, indexes etc. The `.sql
do this are located in the `migrations` folder of your local repository. do this are located in the `migrations` folder of your local repository.
```bash ```bash
ls ./colouring-london/migrations/*.up.sql 2>/dev/null | while read -r migration; do psql -d <colouringlondondb> -U <username> -h localhost < $migration; done; ls ./colouring-london/migrations/*.up.sql 2>/dev/null | while read -r migration; do psql -d <colouringlondondb> < $migration; done;
``` ```
## Running the application ## Running the application