Skip to content

Commit 41ff3d5

Browse files
authored
chore: move database expansion to run in container (#10978)
When moving all development actions to containers in #10803, this step remained outside on the host OS. As `xz-utils` are installed in the `web` image already, use those instead of relying on the host to install them. Refs: #5872 Closes: #5980 Signed-off-by: Mike Fiedler <[email protected]>
1 parent 9332f02 commit 41ff3d5

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ initdb: .state/docker-build-web
8686
docker-compose run --rm web psql -h db -d postgres -U postgres -c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname ='warehouse';"
8787
docker-compose run --rm web psql -h db -d postgres -U postgres -c "DROP DATABASE IF EXISTS warehouse"
8888
docker-compose run --rm web psql -h db -d postgres -U postgres -c "CREATE DATABASE warehouse ENCODING 'UTF8'"
89-
xz -d -f -k dev/$(DB).sql.xz --stdout | docker-compose run --rm web psql -h db -d warehouse -U postgres -v ON_ERROR_STOP=1 -1 -f -
89+
docker-compose run --rm web bash -c "xz -d -f -k dev/$(DB).sql.xz --stdout | psql -h db -d warehouse -U postgres -v ON_ERROR_STOP=1 -1 -f -"
9090
docker-compose run --rm web python -m warehouse db upgrade head
9191
docker-compose run --rm web python -m warehouse sponsors populate-db
9292
$(MAKE) reindex

docs/development/getting-started.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,6 @@ This command will:
241241
* load some example data from `Test PyPI`_, and
242242
* index all the data for the search database.
243243

244-
.. note::
245-
246-
If you get an error about xz, you may need to install the ``xz`` utility.
247-
This is highly likely on macOS and Windows.
248-
249244
Once the ``make initdb`` command has finished, you are ready to continue.
250245

251246

0 commit comments

Comments
 (0)