This commit is contained in:
@@ -11,14 +11,22 @@ jobs:
|
||||
image: ci-java21-node20:latest
|
||||
|
||||
steps:
|
||||
- name: Map gitea into /etc/hosts
|
||||
- name: Map gitea into /etc/hosts (ohne ip)
|
||||
if: ${{ always() }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
GW="$(ip route | awk '/default/ {print $3}')"
|
||||
echo "$GW gitea" >> /etc/hosts
|
||||
getent hosts gitea
|
||||
set -euo pipefail
|
||||
# Default-Gateway aus /proc/net/route in dotted quad umrechnen
|
||||
gw_hex="$(awk '$2=="00000000" {print $3; exit}' /proc/net/route || true)"
|
||||
if [ -n "${gw_hex:-}" ]; then
|
||||
gw="$(printf "%d.%d.%d.%d" 0x${gw_hex:6:2} 0x${gw_hex:4:2} 0x${gw_hex:2:2} 0x${gw_hex:0:2})"
|
||||
else
|
||||
gw="172.17.0.1" # Fallback: Standard-Docker-Bridge
|
||||
fi
|
||||
echo "$gw gitea" >> /etc/hosts
|
||||
echo "$gw host.docker.internal" >> /etc/hosts || true
|
||||
getent hosts gitea || true
|
||||
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
Reference in New Issue
Block a user