File tree Expand file tree Collapse file tree 8 files changed +49
-14
lines changed
docker-entrypoint-initdb.d Expand file tree Collapse file tree 8 files changed +49
-14
lines changed Original file line number Diff line number Diff line change
1
+ .git /
2
+ .direnv /
3
+ .venv /
4
+ .env /
5
+ data /
Original file line number Diff line number Diff line change @@ -25,10 +25,21 @@ jobs:
25
25
- name : Checkout repository
26
26
uses : actions/checkout@v4
27
27
28
+ - name : Set up Docker Compose
29
+ uses : docker/setup-compose-action@v1
30
+
28
31
- name : Test docker image build (local development)
29
32
uses : docker/build-push-action@v6
30
33
with :
31
34
context : .
32
35
push : false
33
36
build-args : |
34
37
REQ_FILE=requirements/${{ matrix.req_file }}
38
+
39
+ - if : matrix.req_file == 'tests.txt'
40
+ name : Run the tests with coverage
41
+ run : |
42
+ docker compose up -d db
43
+ # Wait for Postgres to be ready
44
+ docker compose exec db sh -c 'until pg_isready ; do sleep 1; done'
45
+ docker compose run --rm web make ci
Original file line number Diff line number Diff line change 30
30
31
31
watch-scss :
32
32
watchmedo shell-command --patterns=* .scss --recursive --command=" make compile-scss-debug" $(SCSS )
33
+
34
+ reset-local-db :
35
+ python -m manage flush --no-input
36
+ python -m manage loaddata dev_sites
37
+ python -m manage loaddata doc_releases
38
+ python -m manage loaddata dashboard_production_metrics
39
+ python -m manage update_metrics
Original file line number Diff line number Diff line change @@ -354,12 +354,26 @@ Running Locally with Docker
354
354
355
355
docker compose up
356
356
357
- 3. View the site at http://localhost:8000/
358
-
359
- 4. Run the tests::
357
+ 3. Run the tests::
360
358
361
359
docker compose run --rm web python -m manage test
362
360
361
+ 4. Load the sample / local dev data::
362
+
363
+ docker compose run --rm web make reset-local-db
364
+
365
+ If preferred, refer to the "Install and run locally from a virtual environment"
366
+ for more granular management commands to load specific data sets.
367
+
368
+ 5. View the site at http://www.djangoproject.localhost:8000/
369
+ or http://dashboard.djangoproject.localhost:8000/.
370
+
371
+ 6. For docs, download the documentation (takes awhile)::
372
+
373
+ docker compose exec -it web python -m manage update_docs
374
+
375
+ 7. View the docs at http://docs.djangoproject.localhost:8000/.
376
+
363
377
Pre-commit checks
364
378
-----------------
365
379
Original file line number Diff line number Diff line change @@ -42,4 +42,9 @@ services:
42
42
timeout : 10s
43
43
retries : 10
44
44
volumes :
45
- - ./initdb/tracdb.sql:/docker-entrypoint-initdb.d/tracdb.sql
45
+ # Mount the Postgres initialization scripts
46
+ - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
47
+ # This file contains the initial Trac database schema, but needs
48
+ # to be loaded into the database manually (via 02_trac_schema.sh)
49
+ # since it applies to the trac database, not the main Django database.
50
+ - ./tracdb/trac.sql:/trac.sql
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ PGPASSWORD=secret psql --username=code.djangoproject --dbname=code.djangoproject < /trac.sql
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- python -m manage flush --no-input
4
- PGPASSWORD=secret psql --host db --port 5432 --username=code.djangoproject --dbname=code.djangoproject < tracdb/trac.sql
5
3
python -m manage migrate
6
4
make compile-scss # must come before collectstatic
7
5
python -m manage collectstatic --no-input --clear
8
- python -m manage loaddata dev_sites
9
- python -m manage loaddata doc_releases
10
- # git config --global url."https://".insteadOf git://
11
- # python -m manage update_docs
12
- python -m manage loaddata dashboard_production_metrics
13
- # python -m manage loaddata dashboard_example_data
14
- python -m manage update_metrics
15
- # python -m manage update_index
16
6
17
7
exec " $@ "
You can’t perform that action at this time.
0 commit comments