solstice-ci/.mise/tasks/run/forge-integration
Till Wegmueller c00ce54112
Add heuristic failure detection and improve runner URL configuration
This commit introduces:
- A heuristic to mark jobs as failed if VMs stop quickly without generating logs.
- Improved configuration for runner URLs, including auto-detection of host IPs and default multi-OS runner URLs.
- Updates to the orchestrator's HTTP routing for consistency.
- New task scripts for Forge integration and updates to environment defaults for local development.
2025-11-03 22:36:31 +01:00

31 lines
1.2 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
# Run the Solstice Forge Integration (webhook listener) with local defaults.
# Intended for local development with Hookdeck CLI forwarding.
# Example (in another terminal):
# hookdeck listen http://localhost:8080/webhooks/forgejo
command -v cargo >/dev/null 2>&1 || { echo "cargo is required" >&2; exit 127; }
export RUST_LOG=${RUST_LOG:-info}
# HTTP listener configuration
export HTTP_ADDR=${HTTP_ADDR:-0.0.0.0:8080}
export WEBHOOK_PATH=${WEBHOOK_PATH:-/webhooks/forgejo}
# Optional shared secret used to verify webhook signatures. Leave empty for dev.
export WEBHOOK_SECRET=${WEBHOOK_SECRET:-}
# AMQP defaults for local dev (RabbitMQ)
export AMQP_URL=${AMQP_URL:-amqp://127.0.0.1:5672/%2f}
export AMQP_EXCHANGE=${AMQP_EXCHANGE:-solstice.jobs}
export AMQP_QUEUE=${AMQP_QUEUE:-solstice.jobs.v1}
export AMQP_ROUTING_KEY=${AMQP_ROUTING_KEY:-jobrequest.v1}
export SOL_RUNS_ON=ubuntu-22.04
# Note: Other optional envs are respected by the binary if set:
# FORGEJO_BASE_URL, FORGEJO_TOKEN, FORGE_CONTEXT
# ORCH_HTTP_BASE, S3_ENDPOINT, S3_BUCKET, RUNS_ON_DEFAULT, RUNS_ON_MAP
exec cargo run -p forge-integration -- \
--http-addr "$HTTP_ADDR" \
--webhook-path "$WEBHOOK_PATH"