This commit is contained in:
@@ -12,7 +12,6 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Map gitea into /etc/hosts (ohne ip)
|
- name: Map gitea into /etc/hosts (ohne ip)
|
||||||
if: ${{ always() }}
|
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -23,68 +22,47 @@ jobs:
|
|||||||
gw="172.17.0.1"
|
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
|
|
||||||
getent hosts gitea || true
|
getent hosts gitea || true
|
||||||
|
|
||||||
- name: "Preflight: gitea erreichbar?"
|
|
||||||
if: ${{ always() }}
|
|
||||||
continue-on-error: true
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euxo pipefail
|
|
||||||
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
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Write marker into shared volume
|
|
||||||
if: ${{ always() }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euxo pipefail
|
|
||||||
date | tee /shared_jar_data/PROBE_MARKER.txt
|
|
||||||
ls -ld /shared_jar_data /shared_trigger_dir || true
|
|
||||||
|
|
||||||
- name: 🧰 Gradle vorbereiten & Version
|
- name: 🧰 Gradle vorbereiten & Version
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
if [ ! -f ./gradlew ]; then
|
test -f ./gradlew || { echo "gradlew fehlt – bitte lokal 'gradle wrapper' ausführen und committen."; exit 1; }
|
||||||
echo "gradlew fehlt – bitte lokal einmal 'gradle wrapper' ausführen und committen."; exit 1
|
|
||||||
fi
|
|
||||||
chmod +x ./gradlew
|
chmod +x ./gradlew
|
||||||
./gradlew --version
|
./gradlew --version
|
||||||
|
|
||||||
- name: 🏗️ Build (ohne Tests)
|
- name: 🏗️ Build Backend + Vaadin (Production)
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
./gradlew clean build -x test --no-daemon
|
# Vaadin im Production-Mode bündeln
|
||||||
|
./gradlew clean build -x test --no-daemon -Pvaadin.productionMode
|
||||||
ls -al build/libs
|
ls -al build/libs
|
||||||
|
JAR="$(ls -1 build/libs/*.jar | head -n1)"
|
||||||
|
echo "Gebautes JAR: $JAR"
|
||||||
|
# kurze Sichtprüfung, dass Frontend drin ist
|
||||||
|
jar tf "$JAR" | grep -E 'VAADIN|static/|index\.html' | head || true
|
||||||
|
|
||||||
- name: 📦 JAR ins Shared-Volume kopieren
|
- name: 📦 Nach /shared_jar_data deployen (fester Name + Archiv)
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
ts="$(date +'%Y%m%d-%H%M%S')"
|
ts="$(date +'%Y%m%d-%H%M%S')"
|
||||||
mkdir -p /shared_jar_data/archive
|
mkdir -p /shared_jar_data /shared_jar_data/archive
|
||||||
src="$(ls -1 build/libs/*.jar | head -n1)"
|
SRC="$(ls -1 build/libs/*.jar | head -n1)"
|
||||||
cp "$src" "/shared_jar_data/MyTimeTracker-${ts}.jar"
|
# WICHTIG: Fester Name, den docker-compose startet
|
||||||
cp "$src" "/shared_jar_data/archive/MyTimeTracker-${ts}.jar"
|
cp -f "$SRC" "/shared_jar_data/MyTimeTracker-0.0.1-SNAPSHOT.jar"
|
||||||
echo "Kopiert: $src -> /shared_jar_data/MyTimeTracker-${ts}.jar"
|
# Zusätzlich archivieren
|
||||||
|
cp -f "$SRC" "/shared_jar_data/archive/MyTimeTracker-${ts}.jar"
|
||||||
ls -al /shared_jar_data | tail -n +1
|
ls -al /shared_jar_data | tail -n +1
|
||||||
|
|
||||||
|
- name: 🔁 App neu starten (über Docker-CLI-Container)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euxo pipefail
|
||||||
|
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock docker:27.1.1-cli \
|
||||||
|
restart mytimetracker-app
|
||||||
|
|||||||
Reference in New Issue
Block a user