This commit is contained in:
@@ -9,52 +9,49 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ci-java21-node20:latest
|
||||
|
||||
steps:
|
||||
# 1) gitea-Hostname im Job-Container auflösen (ohne 'ip' Paket)
|
||||
- name: Map gitea into /etc/hosts (ohne ip)
|
||||
if: ${{ always() }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Default-Gateway aus /proc/net/route lesen (hex) und 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
|
||||
gw="172.17.0.1"
|
||||
fi
|
||||
echo "$gw gitea" >> /etc/hosts
|
||||
echo "$gw host.docker.internal" >> /etc/hosts || true
|
||||
getent hosts gitea || true
|
||||
|
||||
# 2) Reichweite kurz prüfen (bricht NICHT ab, nur Diagnose)
|
||||
- name: "Preflight: gitea erreichbar?"
|
||||
if: ${{ always() }}
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
getent hosts gitea
|
||||
bash -lc 'echo > /dev/tcp/gitea/3000' && echo "Port 3000 offen" || echo "Port 3000 NICHT offen"
|
||||
echo "== /etc/hosts =="
|
||||
tail -n +1 /etc/hosts
|
||||
echo "== DNS =="
|
||||
getent hosts gitea || true
|
||||
getent hosts host.docker.internal || true
|
||||
echo "== HTTP-Check (curl) =="
|
||||
for url in "http://gitea:3000/api/v1/version" "http://gitea:3000" "http://host.docker.internal:3000"; do
|
||||
echo "Teste: $url"
|
||||
# 5s Timeout, nur Status anzeigen
|
||||
if curl -fsS -m 5 -o /dev/null -w "OK HTTP %{http_code} von %{remote_ip}\n" "$url"; then
|
||||
echo "Erreichbar: $url"
|
||||
break
|
||||
else
|
||||
echo "Nicht erreichbar: $url" || true
|
||||
fi
|
||||
done
|
||||
|
||||
# 3) Normaler Checkout
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# 3b) Fallback-Checkout (nur falls Schritt oben rot war)
|
||||
- name: Fallback-Checkout (manuell)
|
||||
if: ${{ failure() }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
rm -rf .git
|
||||
git init .
|
||||
git remote add origin "http://gitea:3000/${{ github.repository }}"
|
||||
git config --local http.http://gitea:3000/.extraheader "AUTHORIZATION: basic ${{ github.token }}"
|
||||
git -c protocol.version=2 fetch --depth=1 origin "${{ github.sha }}"
|
||||
git checkout -qf FETCH_HEAD
|
||||
|
||||
# 4) Marker ins Shared-Volume (zeigt, dass Volumes im Job-Container gemountet sind)
|
||||
- name: Write marker into shared volume
|
||||
if: ${{ always() }}
|
||||
shell: bash
|
||||
@@ -63,7 +60,6 @@ jobs:
|
||||
date | tee /shared_jar_data/PROBE_MARKER.txt
|
||||
ls -ld /shared_jar_data /shared_trigger_dir || true
|
||||
|
||||
# 5) Gradle Wrapper prüfen + Version ausgeben
|
||||
- name: 🧰 Gradle vorbereiten & Version
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -74,7 +70,6 @@ jobs:
|
||||
chmod +x ./gradlew
|
||||
./gradlew --version
|
||||
|
||||
# 6) Build ohne Tests
|
||||
- name: 🏗️ Build (ohne Tests)
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -82,7 +77,6 @@ jobs:
|
||||
./gradlew clean build -x test --no-daemon
|
||||
ls -al build/libs
|
||||
|
||||
# 7) Artefakt ins Shared-Volume kopieren (und archivieren)
|
||||
- name: 📦 JAR ins Shared-Volume kopieren
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user