aboutsummaryrefslogtreecommitdiff
path: root/INSTALL-DEV
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-04-04 20:53:00 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-04-19 22:16:46 +0300
commitdbbc19b77dcf6ea828aabd64d7aa8cab9635aaf5 (patch)
treec0b9b449b7064dff3613628022224e6c18148c3e /INSTALL-DEV
parentefb9c3e0e6b612d5bfadc7a2b984c14b5439335c (diff)
Implement build task, result and log requests handling
Diffstat (limited to 'INSTALL-DEV')
-rw-r--r--INSTALL-DEV49
1 files changed, 37 insertions, 12 deletions
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 <user>;
-GRANT ALL PRIVILEGES ON DATABASE brep TO <user>;
+GRANT ALL PRIVILEGES ON DATABASE brep_package, brep_build TO <user>;
CREATE USER "www-data" INHERIT IN ROLE <user>;
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 <BREP-OUT-ROOT> and <BREP-SRC-ROOT> with the actual absolute paths
LoadModule brep_module <BREP-OUT-ROOT>/mod/mod_brep.so
</IfModule>
+ # 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 <user>'
+$ psql -d brep_package -c 'DROP OWNED BY <user>'
+$ psql -d brep_build -c 'DROP OWNED BY <user>'