This commit is contained in:
@@ -9,52 +9,49 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: ci-java21-node20:latest
|
image: ci-java21-node20:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# 1) gitea-Hostname im Job-Container auflösen (ohne 'ip' Paket)
|
|
||||||
- name: Map gitea into /etc/hosts (ohne ip)
|
- name: Map gitea into /etc/hosts (ohne ip)
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
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)"
|
gw_hex="$(awk '$2=="00000000" {print $3; exit}' /proc/net/route || true)"
|
||||||
if [ -n "${gw_hex:-}" ]; then
|
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})"
|
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
|
else
|
||||||
gw="172.17.0.1" # Fallback: Standard Docker bridge
|
gw="172.17.0.1"
|
||||||
fi
|
fi
|
||||||
echo "$gw gitea" >> /etc/hosts
|
echo "$gw gitea" >> /etc/hosts
|
||||||
echo "$gw host.docker.internal" >> /etc/hosts || true
|
echo "$gw host.docker.internal" >> /etc/hosts || true
|
||||||
getent hosts gitea || true
|
getent hosts gitea || true
|
||||||
|
|
||||||
# 2) Reichweite kurz prüfen (bricht NICHT ab, nur Diagnose)
|
|
||||||
- name: "Preflight: gitea erreichbar?"
|
- name: "Preflight: gitea erreichbar?"
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
getent hosts gitea
|
echo "== /etc/hosts =="
|
||||||
bash -lc 'echo > /dev/tcp/gitea/3000' && echo "Port 3000 offen" || echo "Port 3000 NICHT offen"
|
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
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Write marker into shared volume
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -63,7 +60,6 @@ jobs:
|
|||||||
date | tee /shared_jar_data/PROBE_MARKER.txt
|
date | tee /shared_jar_data/PROBE_MARKER.txt
|
||||||
ls -ld /shared_jar_data /shared_trigger_dir || true
|
ls -ld /shared_jar_data /shared_trigger_dir || true
|
||||||
|
|
||||||
# 5) Gradle Wrapper prüfen + Version ausgeben
|
|
||||||
- name: 🧰 Gradle vorbereiten & Version
|
- name: 🧰 Gradle vorbereiten & Version
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -74,7 +70,6 @@ jobs:
|
|||||||
chmod +x ./gradlew
|
chmod +x ./gradlew
|
||||||
./gradlew --version
|
./gradlew --version
|
||||||
|
|
||||||
# 6) Build ohne Tests
|
|
||||||
- name: 🏗️ Build (ohne Tests)
|
- name: 🏗️ Build (ohne Tests)
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -82,7 +77,6 @@ jobs:
|
|||||||
./gradlew clean build -x test --no-daemon
|
./gradlew clean build -x test --no-daemon
|
||||||
ls -al build/libs
|
ls -al build/libs
|
||||||
|
|
||||||
# 7) Artefakt ins Shared-Volume kopieren (und archivieren)
|
|
||||||
- name: 📦 JAR ins Shared-Volume kopieren
|
- name: 📦 JAR ins Shared-Volume kopieren
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user