#!/usr/bin/env bash
set -eu
# Place gitlab-custom-port-watch.e2e.ts in scripts/scenarios of current main.
fixture_dir=$(mktemp -d)
trap 'rm -rf "$fixture_dir"' EXIT
export GLAB_CONFIG_DIR="$fixture_dir"
cat > "$fixture_dir/config.yml" <<'CONFIG'
host: 127.0.0.1:9999
hosts:
  127.0.0.1:9999:
    token: synthetic-fixture-token
    api_protocol: http
    git_protocol: http
    api_host: 127.0.0.1:9999
    user: scenario
CONFIG
chmod 600 "$fixture_dir/config.yml"
export T3_SCENARIO_INHERIT_ENV=GLAB_CONFIG_DIR
export T3CODE_DEV_SEED=0
vp run scenarios:prove scripts/scenarios/gitlab-custom-port-watch.e2e.ts \
  --base c1464d6774cf4c690aba3fb20b8094a35396d130 \
  --head fbe0f227bb5d10cffc33da6ac045dc6d7e7572b5 \
  --upload-command 'ghdrop upload'
