# Coverage site deployment

This directory hosts a small static site for historical coverage reports.

## Layout

- `compose.yml`: starts the nginx web server and the refresh utility container.
- `deploy.sh`: build/start the web server stack.
- `down.sh`: stop the web server stack.
- `cron-refresh.sh`: refresh reports from MinIO and rebuild the landing page. Suitable for `crontab`.
- `refresh.sh`: container entrypoint that syncs MinIO tarballs/manifests, expands reports, and regenerates the index.
- `generate_index.py`: scans synced manifest files and emits `index.html`, `index.json`, and `latest/index.html`.

## Setup

1. Copy `.env.example` to `.env` and fill in the MinIO credentials.
2. Start the site:

   ```bash
   ./deploy.sh
   ```

3. Run one refresh:

   ```bash
   ./cron-refresh.sh
   ```

4. Add a periodic refresh to `crontab`:

   ```bash
   */30 * * * * /path/to/cloud-storage-engine/scripts/coverage-site/cron-refresh.sh >> /var/log/cse-coverage-refresh.log 2>&1
   ```

The site root is `scripts/coverage-site/public/`. Synced raw MinIO objects live in `public/raw/`, extracted reports live in `public/storage/reports/`, and nginx serves the site on `http://localhost:${COVERAGE_HTTP_PORT}`.
