This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Probe-Mounts
|
name: Build-und-Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -9,26 +9,52 @@ 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"
|
gw="172.17.0.1" # Fallback: Standard Docker bridge
|
||||||
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?"
|
||||||
|
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
|
- 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
|
||||||
@@ -37,6 +63,7 @@ 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: |
|
||||||
@@ -47,6 +74,7 @@ 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: |
|
||||||
@@ -54,6 +82,7 @@ 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