Instead of clearing the entire screen every 5 seconds, the script now:
- Prints the header once and saves cursor position
- Fetches all API data before updating display (no blank period)
- Restores cursor position and updates only the content area
- Hides cursor during display for cleaner look
- Shows cursor on exit via cleanup trap
Uses tput commands:
- sc/rc: Save/restore cursor position
- ed: Clear from cursor to end of screen
- civis/cnorm: Hide/show cursor
- Added format_time_ago() function
- Handles both GNU date (Linux) and BSD date (macOS)
- Properly parses ISO 8601 timestamps with UTC timezone
- Shows: 30s ago, 5m ago, 2h ago, 3d ago
- Changed 'Created' field from raw timestamp to human-readable format
- Updated main app project ID: 77257437 → 77618300 (towerops/towerops)
- Fixed duration formatting to handle decimal seconds from GitLab API
- Script now fetches correct current pipelines instead of old deleted project
- Moved debug fields (Local HEAD, Created, Commit) into monitoring loop
- Removed duplicate output that was immediately cleared
- Added warning when local commit doesn't match pipeline commit
- Now debug info stays visible throughout monitoring
- Show local HEAD commit for comparison
- Add explicit sort order (id DESC) to get most recent pipeline
- Display pipeline created time and commit SHA
- Remove duplicate pipeline info output
- Changed from URL-encoded paths to numeric project IDs
- Added -L flag to curl to follow redirects
- Improved error handling with HTTP status codes
- Shows API errors with response body
Features:
- Auto-detects project from git remote
- Shows real-time pipeline progress
- Color-coded job statuses
- Links to failed job logs
- For main app: monitors Kubernetes rollout
- Auto-refreshes every 5 seconds
Usage:
export GITLAB_TOKEN=<token>
./scripts/monitor-deploy.sh [app|agent]
Or just run from repo directory for auto-detection