summaryrefslogtreecommitdiff
path: root/bin/cuirass-send-events.in
Commit message (Collapse)AuthorAge
* Support publishing build eventsChristopher Baines2019-11-28
Add a table to store events, which have a type and a JSON blob. These can be used to record changes, this commit inserts events when new builds are created, and when the status of builds change. The EventsOutbox table is then used to track when events have been sent out. This is done through the new cuirass-send-events script. * Makefile.am (bin_SCRIPTS): Add bin/cuirass-send-events. (dist_pkgmodule_DATA): Add src/cuirass/send-events.scm. (dist_sql_DATA): Add src/sql/upgrade-5.sql. (EXTRA_DIST): bin/cuirass-send-events.in. (bin/cuirass-send-events): New rule. * bin/cuirass-send-events.in: New file. * src/cuirass/send-events.scm: New file. * src/sql/upgrade-5.sql: New file. * src/cuirass/base.scm (build-packages): Call db-add-event after db-add-build. * src/cuirass/database.scm (changes-count): New procedure. (db-update-build-status!): Call db-add-event after updating the build status. (db-add-event): New procedure. (db-get-events-in-outbox): New procedure. (db-delete-events-from-output-with-ids-<=-to): New procedure. * src/cuirass/http.scm (handle-events-request): New procedure. (url-handler): Handle /api/build-events requests. * src/schema.sql (Events, EventOutbox): New tables.