From dbbc19b77dcf6ea828aabd64d7aa8cab9635aaf5 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 4 Apr 2017 20:53:00 +0300 Subject: Implement build task, result and log requests handling --- INSTALL-DEV | 49 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) (limited to 'INSTALL-DEV') diff --git a/INSTALL-DEV b/INSTALL-DEV index 8ad9ae7..8f5ba6f 100644 --- a/INSTALL-DEV +++ b/INSTALL-DEV @@ -24,39 +24,50 @@ setfacl -m g:www-data:rx ~/ ~/projects group, not user. However, most installations use the same name for both.] -1. Create PostgreSQL User and Database +1. Create PostgreSQL User and Databases $ sudo sudo -u postgres psql # Note: double sudo is not a mistake. -CREATE DATABASE brep TEMPLATE template0 ENCODING 'UTF8' +CREATE DATABASE brep_package TEMPLATE template0 ENCODING 'UTF8' +LC_COLLATE 'en_US.UTF8' LC_CTYPE 'en_US.UTF8'; +CREATE DATABASE brep_build TEMPLATE template0 ENCODING 'UTF8' LC_COLLATE 'en_US.UTF8' LC_CTYPE 'en_US.UTF8'; CREATE USER ; -GRANT ALL PRIVILEGES ON DATABASE brep TO ; +GRANT ALL PRIVILEGES ON DATABASE brep_package, brep_build TO ; CREATE USER "www-data" INHERIT IN ROLE ; Exit psql (^D), then make sure the logins work: -$ psql -d brep -$ sudo sudo -u www-data psql -d brep +$ psql -d brep_package +^D +$ psql -d brep_build +^D +$ sudo sudo -u www-data psql -d brep_package +^D +$ sudo sudo -u www-data psql -d brep_build +^D To troubleshoot, see PostgreSQL logs, for example: $ sudo tail -f /var/log/postgresql/*.log -2. Create Database Schema and Load the Repository +2. Create Database Schemes and Load the Repository All the commands are executed from brep project root. -$ migrate/brep-migrate +$ migrate/brep-migrate package # Or use some other loader config. # $ load/brep-load --bpkg ../bpkg/bpkg/bpkg tests/load/loadtab +$ migrate/brep-migrate build + To verify: -$ psql -d brep -c 'SELECT name, summary FROM repository' +$ psql -d brep_package -c 'SELECT name, summary FROM repository' +$ psql -d brep_build -c 'SELECT package_name FROM build' # Empty row set. 3. Setup Apache2 Module @@ -73,6 +84,18 @@ replacing and with the actual absolute paths LoadModule brep_module /mod/mod_brep.so + # Repository email. This email is used for the From: header in emails + # send by brep (for example, build failure notifications). + # + brep-email admin@example.org + + # Repository host. It specifies the scheme and the host address (but + # not the root path; see brep-root below) that will be used whenever + # brep needs to construct an absolute URL to one of its locations (for + # example, a link to a build log that is being send via email). + # + brep-host https://example.org + # Repository root. Use / for web server root. And don't forget to also # update the Location and Alias directives below. # @@ -117,15 +140,17 @@ $ sudo tail -f /var/log/apache2/error.log 4. Reloading During Development -To do a "complete reload" (i.e., recreate database schema, load the repository +To do a "complete reload" (i.e., recreate database schemes, load the repository data, and reload the Apache2 plugin), execute the following from brep/: -migrate/brep-migrate --recreate +migrate/brep-migrate --recreate package +migrate/brep-migrate --recreate build load/brep-load --bpkg ../bpkg/bpkg/bpkg tests/load/loadtab sudo /etc/init.d/apache2 restart sudo systemctl restart apache2 -Note that if instead you need to recreate the whole database (e.g., migration +Note that if instead you need to recreate the whole databases (e.g., migration is not possible), then one way to do it would be: -$ psql -d brep -c 'DROP OWNED BY ' +$ psql -d brep_package -c 'DROP OWNED BY ' +$ psql -d brep_build -c 'DROP OWNED BY ' -- cgit v1.1