ReportLog
Documentation menu

Deploying

sudo reportlog deploy            # the followed branch (below); at first DEPLOY_REF (main)
sudo reportlog deploy v1.2.0     # or any branch, tag or commit

Each release records the branch it came from in releases/<id>/BRANCH (none for a bare commit that is no branch's tip); reportlog releases and the Updates screen show it. A commit older than the database is refused before anything is unpacked: one whose apps/api/migrations/ lacks a migration the database has already applied would run older code than its database. Going back to older code is a rollback (below), never a deploy.

What happens, in this order. Everything that can fail happens before the running release is touched:

  1. The commit is fetched and unpacked into a new releases/<id> directory.
  2. Dependencies are installed and the website is built, as the reportlog user (so no package's install script runs as root). The build tools are then removed, and the release is handed to root and made read-only.
  3. Migrations run against the live database, while the old release is still serving.
  4. The release's systemd units and Caddyfile are installed. A release that adds or removes a timer installs or removes it here. current is switched and the API restarted.
  5. If the API does not answer /api/health within 30 seconds, current is switched back and the old release restarted.
If this failsThen
fetch or buildNothing changed. The release directory is kept as <id>.failed to look at.
a migrationcurrent is not switched; the old release keeps running. The failing migration's transaction rolled back. Any migrations before it in the same deploy stay applied (see below).
the new release's startIt is switched back automatically. Its migrations stay applied.

The deploy ends by running the doctor.

See this page's source