Move the database setup section later in the README

Given that the .envrc file and direnv setup in the previous step may provide
the PostgreSQL tools that you need to run here, it's probably more sensible to
re-order the steps in this way.
This commit is contained in:
Christopher Baines 2019-10-15 19:18:07 +01:00
parent 4ce8d9e830
commit d0a1ebcb11

62
README
View file

@ -23,37 +23,6 @@ the #guix IRC channel on Freenode. You can also email help-guix@gnu.org, please
include the step you got to, and the problem you encountered (with the error
message if applicable).
** Setup the database
Dumps of the database behind data.guix.gnu.org are available at
http://data.guix.gnu.org/dumps, use the following URL to download the latest
small dump.
http://data.guix.gnu.org/dumps/latest/guix_data_service_small.dump
There are multiple ways you can setup the database, the instructions here
involve creating a =guix_data_service= user with a password, then connecting
to the database over the local network interface.
To create the user and database use the scripts from PostgreSQL. The
=createuser= command will prompt for a password for the database user, you'll
need this at multiple points so it might be useful to keep it simple.
#+BEGIN_SRC shell
createuser guix_data_service --pwprompt
createdb guix_data_service --owner=guix_data_service
#+END_SRC
You may need to run these commands as the postgres user.
To restore the downloaded dump, run =pg_restore=. This command should prompt
for a password, at which point enter the password for the database user that
you set earlier.
#+BEGIN_SRC shell
pg_restore --jobs=4 --user=guix_data_service --host=127.0.0.1 --dbname=guix_data_service guix_data_service_small.dump
#+END_SRC
** Cloning the repository
To clone the Git repository, run the following command:
@ -86,6 +55,37 @@ export GUIX_DATA_SERVICE_DATABASE_PARAMSTRING="dbname=guix_data_service user=gui
After, run =direnv reload= to update the environment in your shell.
** Setup the database
Dumps of the database behind data.guix.gnu.org are available at
http://data.guix.gnu.org/dumps, use the following URL to download the latest
small dump.
http://data.guix.gnu.org/dumps/latest/guix_data_service_small.dump
There are multiple ways you can setup the database, the instructions here
involve creating a =guix_data_service= user with a password, then connecting
to the database over the local network interface.
To create the user and database use the scripts from PostgreSQL. The
=createuser= command will prompt for a password for the database user, you'll
need this at multiple points so it might be useful to keep it simple.
#+BEGIN_SRC shell
createuser guix_data_service --pwprompt
createdb guix_data_service --owner=guix_data_service
#+END_SRC
You may need to run these commands as the postgres user.
To restore the downloaded dump, run =pg_restore=. This command should prompt
for a password, at which point enter the password for the database user that
you set earlier.
#+BEGIN_SRC shell
pg_restore --jobs=4 --user=guix_data_service --host=127.0.0.1 --dbname=guix_data_service guix_data_service_small.dump
#+END_SRC
** Building the source files
The following three commands will compile the =.go= files and generate the