This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Build-und-Deploy
|
name: Build-und-Deploy (Probe)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -7,76 +7,28 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# WICHTIG: hier KEINE container.volumes eintragen (die kommen über den Runner)
|
||||||
container:
|
container:
|
||||||
image: ci-java21-node20:latest
|
image: ci-java21-node20:latest
|
||||||
volumes:
|
|
||||||
- shared_jar_data:/shared_jar_data
|
|
||||||
- shared_trigger_dir:/shared_trigger_dir
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: 📥 Repository auschecken
|
- name: 📥 Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Container offen halten (60s)
|
- name: "🔎 Probe: Mounts & Env"
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
echo "Container: $(hostname)"
|
ts="$(date +'%Y%m%d-%H%M%S')"
|
||||||
sleep 60
|
LOG="/shared_jar_data/ci-probe.log"
|
||||||
|
|
||||||
- name: 🔎 Umgebung & Volumes
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euxo pipefail |& tee -a "/shared_jar_data/ci-$(date +%Y%m%d-%H%M%S).log"
|
|
||||||
echo "JAVA_HOME=${JAVA_HOME:-<leer>}" |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
java -version |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
node -v |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
pnpm -v || true |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
ls -ld /shared_jar_data /shared_trigger_dir |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
|
|
||||||
- name: ⚙️ Gradle konfigurieren
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euxo pipefail |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
mkdir -p ~/.gradle
|
|
||||||
{
|
{
|
||||||
echo "org.gradle.daemon=false"
|
echo "=== PROBE $ts ==="
|
||||||
echo "org.gradle.warning.mode=all"
|
echo "HOST=$(hostname)"
|
||||||
echo "org.gradle.java.installations.auto-download=false"
|
echo "PWD=$(pwd)"
|
||||||
echo "org.gradle.java.installations.fromEnv=JAVA_HOME"
|
echo "JAVA_HOME=${JAVA_HOME:-<leer>}"
|
||||||
echo "org.gradle.java.installations.paths=${JAVA_HOME}"
|
java -version
|
||||||
} > ~/.gradle/gradle.properties
|
node -v
|
||||||
cat ~/.gradle/gradle.properties |& tee -a /shared_jar_data/ci-*.log
|
pnpm -v || true
|
||||||
|
ls -ld /shared_jar_data /shared_trigger_dir || true
|
||||||
- name: 🔎 Gradle-Info
|
} |& tee -a "$LOG"
|
||||||
shell: bash
|
echo "$ts" > "/shared_jar_data/probe-$ts.txt"
|
||||||
run: |
|
|
||||||
set -euxo pipefail |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
chmod +x gradlew || true
|
|
||||||
./gradlew --version |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
./gradlew -q javaToolchains || true |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
|
|
||||||
- name: 🛠 Baue das Projekt (ohne Tests)
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euxo pipefail |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
./gradlew clean bootJar -x test --info --stacktrace |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
|
|
||||||
- name: 📦 Artefakt finden & kopieren
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euxo pipefail |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
ls -l build/libs |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
ARTIFACT="$(ls -t build/libs/*.jar 2>/dev/null | head -n1)"
|
|
||||||
test -n "${ARTIFACT}" && test -f "${ARTIFACT}" || { echo "Kein JAR gefunden!"; exit 1; }
|
|
||||||
timestamp="$(date +'%Y%m%d-%H%M%S')"
|
|
||||||
cp "${ARTIFACT}" /shared_jar_data/MyTimeTracker.jar
|
|
||||||
cp "${ARTIFACT}" "/shared_jar_data/archive/MyTimeTracker-${timestamp}.jar"
|
|
||||||
ls -l /shared_jar_data /shared_jar_data/archive |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
|
|
||||||
- name: 🚦 Neustart der Anwendung triggern
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euxo pipefail |& tee -a /shared_jar_data/ci-*.log
|
|
||||||
mkdir -p /shared_trigger_dir
|
|
||||||
touch /shared_trigger_dir/restart-requested
|
|
||||||
|
|||||||
Reference in New Issue
Block a user