#!/usr/bin/env bash
# scripts/ci/gitlab-ci-local - Run GitLab CI pipeline locally
set -euo pipefail

# Usage: ./scripts/ci/gitlab-ci-local [job-name]
# Examples:
#   ./scripts/ci/gitlab-ci-local          # Run all jobs
#   ./scripts/ci/gitlab-ci-local test:8.4 # Run specific job
#   ./scripts/ci/gitlab-ci-local --list   # List available jobs

if [ "$#" -eq 0 ]; then
    npx gitlab-ci-local
elif [ "$1" = "--list" ] || [ "$1" = "-l" ]; then
    npx gitlab-ci-local --list
else
    npx gitlab-ci-local "$@"
fi