diff --git a/.gitea/workflows/buildAndDeply.yaml b/.gitea/workflows/buildAndDeply.yaml index a300357..0ecf9fe 100644 --- a/.gitea/workflows/buildAndDeply.yaml +++ b/.gitea/workflows/buildAndDeply.yaml @@ -1,4 +1,4 @@ -name: Probe-Mounts +name: Build-und-Deploy on: push: @@ -9,26 +9,52 @@ 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" + 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 + # 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" + + # 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 @@ -37,6 +63,7 @@ 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: | @@ -47,6 +74,7 @@ jobs: chmod +x ./gradlew ./gradlew --version + # 6) Build ohne Tests - name: 🏗️ Build (ohne Tests) shell: bash run: | @@ -54,6 +82,7 @@ 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: |