🏗️ Weather Analytics — Web Deployment Strategy

Migration plan from GitLab Pages to dedicated web hosting • Aug 2026

Current Architecture

CURRENT

Problem: JSON snapshots (~180KB each × 4 cities × daily) live in git — bloating repo history. Reports are deployed to 3 places redundantly.

┌─────────────────────────────────────────────────────────────┐ │ GitLab Repo (misc_scripts) │ │ ├─ scripts/ (code) │ │ ├─ shared/ (code) │ │ ├─ data/forecasts/ (JSON snapshots — WRONG PLACE) │ │ ├─ data/scores.json (evaluation data — WRONG PLACE) │ │ └─ public_html/ (generated HTML — WRONG PLACE) │ └─────────────────┬───────────────────────────────────────────┘ │ git push → GitLab CI → Pages │ scp → internal server ▼ ┌─────────────────────────────────┐ ┌────────────────────────┐ │ GitLab Pages │ │ seroius01600 (scp) │ │ misc-scripts-adc2c4.gitlab.io │ │ internal mirror │ └─────────────────────────────────┘ └────────────────────────┘

Target Architecture

NEW

Principle: Git stores code only. Web server stores data + output. Clean separation of concerns.

┌───────────────────────────────┐ ┌───────────────────────────────────┐ │ GitLab Repo (code only) │ │ Dedicated Web Server │ │ │ │ │ │ scripts/ │ │ /var/www/weather/ │ │ shared/ │ │ ├─ public/ (HTML output) │ │ templates/ │ │ │ ├─ index.html │ │ run-and-publish.py │ │ │ ├─ i18n.js │ │ requirements.txt │ │ │ ├─ weather-forecast-*.html │ │ .gitignore (data/, public/) │ │ │ ├─ weather-history-*.html │ │ │ │ │ ├─ model-rankings.html │ │ NO data/ │ │ │ └─ headache-analysis.html │ │ NO public_html/ │ │ ├─ data/ │ │ │ │ │ ├─ forecasts/*.json │ │ │ │ │ ├─ scores.json │ │ │ │ │ └─ headaches.txt │ │ │ │ └─ repo/ (git clone) │ └───────────────────────────────┘ └───────────────────────────────────┘ ▲ │ │ git pull (daily cron) │ nginx serves /public/ └─────────────────────────────────────────┘

Deployment Options

Option A: Cron on the Web Server (recommended)

Simplest. Everything runs where the output lives. No network transfers.

StepWhat happens
1Clone repo once: git clone <repo> /var/www/weather/repo
2Set up Python venv + install deps on the server
3Cron at 07:00: cd repo && git pull && python3 run-and-publish.py
4Scripts write JSON to /var/www/weather/data/
5Scripts write HTML to /var/www/weather/public/
6Nginx serves /var/www/weather/public/ as web root

Pros: No scp, no CI, no git push for data. Instant. Simple.

Cons: Need SSH + Python 3.12 on the server.

Option B: Cron on Build Server + rsync to Web

Keep cron on seroiuts00655. Sync output to web server.

StepWhat happens
1Cron at 07:00 on build server runs scripts (same as today)
2Scripts write to local /tmp/weather-output/
3rsync -az /tmp/weather-output/ user@webserver:/var/www/weather/
4Data + HTML synced in one shot

Pros: No Python needed on web server. Familiar scp/rsync pattern.

Cons: Extra network hop. Need SSH key to web server from build server.

Code Changes Required

# 1. Add to .gitignore:
data/
public_html/

# 2. Environment-based paths (run-and-publish.py):
DATA_DIR = os.environ.get("WEATHER_DATA_DIR", "./data")
OUTPUT_DIR = os.environ.get("WEATHER_OUTPUT_DIR", "./public_html")

# 3. Remove from scripts:
- scp deploy logic (or make it optional)
- git add/commit/push of data + HTML
- GitLab CI pages job

# 4. Nginx config:
server {
    server_name weather.yourdomain.com;
    root /var/www/weather/public;
    index index.html;
}

What I Need From You

#QuestionWhy
1SSH access details (host, user, key)To set up deployment
2Server OS and available toolsTo know if Python 3.12 is available
3Web server software (nginx, Apache, Caddy?)To configure serving
4Domain nameTo update links and references
5Where should cron run?Option A vs B
6Keep GitLab Pages as fallback?Dual deploy or remove?

Migration Checklist

Once you have the answers above, the migration takes ~30 minutes:

  1. Set up Python venv on target (or configure rsync)
  2. Configure env vars for data/output paths
  3. Update run-and-publish.py to use new paths
  4. Remove git push/scp deploy steps
  5. Set up cron on target
  6. Configure web server (nginx/Caddy)
  7. Update .gitignore — stop tracking data/HTML
  8. DNS: point domain to server
  9. Test full run
  10. Remove old GitLab Pages CI (optional)