diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4237a78..29f89f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: PGDATA: /tmp/pgdata ports: - 5442:5432 - options: --tmpfs /var/lib/postgresql/data --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 defaults: run: working-directory: ./backend diff --git a/scripts/run-e2e.sh b/scripts/run-e2e.sh index 45c31b7..4408147 100755 --- a/scripts/run-e2e.sh +++ b/scripts/run-e2e.sh @@ -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 dev proto dhcp src 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 (