fix: add internal host routing for Gitea Actions environment in e2e
CI / Generate Certificates (pull_request) Successful in 29s
CI / Frontend CI (pull_request) Successful in 1m10s
CI / E2E Tests (pull_request) Successful in 6m36s
ci.yml / Backend CI (pull_request) Has been cancelled

This commit is contained in:
me
2026-05-05 18:30:06 +05:30
parent 283417fe24
commit d2d8c88f69
2 changed files with 14 additions and 1 deletions
+13
View File
@@ -55,6 +55,19 @@ until $CONTAINER_BIN exec "$DB_NAME" pg_isready -U "${DB_USER:-test}" >/dev/null
done
export PIKU_ENV_FILE="$ENV_FILE"
# NOTE: When running in Gitea Actions (within container), 127.0.0.1 is the actions instance.
# We must route DB and mail traffic to the docker host instead.
if [ "$GITEA_ACTIONS" = "true" ]; then
sudo apt-get update && sudo apt-get install -y iproute2
# Sample: "default via <internal docker host IP> dev <network interface> proto dhcp src <IP> metric 100"
HOST_IP=$(ip route show default | awk '/default/ {print $3}')
echo "Running on Gitea. Internal Docker host... $HOST_IP"
export DB_HOST=$HOST_IP
export EMAIL_HOST=$HOST_IP
fi
echo "Starting Backend..."
mkdir -p ./tmp/logs
(