chore: version 0.9.4 release

This commit is contained in:
2026-03-25 12:22:50 +01:00
parent 6e4f19a965
commit fcf938ee6f
6 changed files with 19 additions and 63 deletions

View File

@@ -4,7 +4,7 @@ WORKDIR /build/frontend
ARG VITE_API_URL=/api
ENV VITE_API_URL=${VITE_API_URL}
COPY backend/src/main/resources/application.yml /build/backend/src/main/resources/application.yml
COPY backend/pom.xml /build/backend/pom.xml
COPY frontend/package*.json ./
RUN npm ci

View File

@@ -12,7 +12,7 @@
<groupId>de.svencarstensen</groupId>
<artifactId>muh-backend</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.9.4</version>
<name>muh-backend</name>
<description>MUH application backend</description>

View File

@@ -32,7 +32,7 @@ spring:
muh:
app:
version: 0.9.3
version: '@project.version@'
cors:
allowed-origins: ${MUH_ALLOWED_ORIGINS:http://localhost:5173,http://localhost:3000}
security:

View File

@@ -4,7 +4,7 @@ set -euo pipefail
readonly SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
readonly REGISTRY_IMAGE="registry.assecutor.org/muh"
readonly APP_CONFIG_FILE="${SCRIPT_DIR}/backend/src/main/resources/application.yml"
readonly POM_FILE="${SCRIPT_DIR}/backend/pom.xml"
usage() {
cat <<'EOF'
@@ -20,7 +20,7 @@ Voraussetzungen:
- Login zur Registry wurde bereits ausgeführt:
docker login registry.assecutor.org
Ohne Versionsargument wird automatisch die Version aus backend/src/main/resources/application.yml verwendet.
Ohne Versionsargument wird automatisch die Version aus backend/pom.xml verwendet.
Optional kann VITE_API_URL als Umgebungsvariable gesetzt werden.
EOF
}
@@ -35,39 +35,13 @@ require_command() {
}
resolve_app_version() {
[[ -f "${APP_CONFIG_FILE}" ]] || fail "'${APP_CONFIG_FILE}' wurde nicht gefunden."
[[ -f "${POM_FILE}" ]] || fail "'${POM_FILE}' wurde nicht gefunden."
local version
version="$(
awk '
$0 ~ /^muh:[[:space:]]*$/ {
in_muh = 1
in_app = 0
next
}
version="$(sed -n '/<parent>/,/<\/parent>/!{ s/.*<version>\(.*\)<\/version>.*/\1/p; }' "${POM_FILE}" | head -1)"
in_muh && $0 ~ /^[^[:space:]]/ {
in_muh = 0
in_app = 0
}
in_muh && $0 ~ /^[[:space:]][[:space:]]app:[[:space:]]*$/ {
in_app = 1
next
}
in_app && $0 ~ /^[[:space:]][[:space:]][^[:space:]]/ {
in_app = 0
}
in_muh && in_app && match($0, /^[[:space:]][[:space:]][[:space:]][[:space:]]version:[[:space:]]*"?([0-9]+\.[0-9]+\.[0-9]+)"?[[:space:]]*$/, a) {
print a[1]
exit
}
' "${APP_CONFIG_FILE}"
)"
[[ -n "${version}" ]] || fail "Version konnte nicht aus ${APP_CONFIG_FILE} ermittelt werden."
[[ -n "${version}" ]] || fail "Version konnte nicht aus ${POM_FILE} ermittelt werden."
[[ "${version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || fail "Version in ${POM_FILE} muss das Format x.y.z haben."
echo "${version}"
}

View File

@@ -126,7 +126,7 @@ export default function UserManagementPage() {
if (!userToUpdate) return;
await apiPost("/portal/users", {
id: userId,
...userToUpdate,
active: newStatus,
});

View File

@@ -4,35 +4,17 @@ import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
const CONFIG_DIR = path.dirname(fileURLToPath(import.meta.url));
const APPLICATION_CONFIG_PATH = path.resolve(CONFIG_DIR, "../backend/src/main/resources/application.yml");
const POM_PATH = path.resolve(CONFIG_DIR, "../backend/pom.xml");
function resolveAppVersion() {
const lines = fs.readFileSync(APPLICATION_CONFIG_PATH, "utf8").split(/\r?\n/);
let inMuhSection = false;
let inAppSection = false;
for (const line of lines) {
const trimmedLine = line.trim();
if (!trimmedLine || trimmedLine.startsWith("#")) {
continue;
const content = fs.readFileSync(POM_PATH, "utf8");
const parentRange = content.indexOf("<parent>");
const parentEnd = content.indexOf("</parent>");
const withoutParent = content.slice(0, parentRange) + content.slice(parentEnd + "</parent>".length);
const match = withoutParent.match(/<version>(\d+\.\d+\.\d+)<\/version>/);
if (match) {
return match[1];
}
const indentation = line.length - line.trimStart().length;
if (indentation === 0) {
inMuhSection = trimmedLine === "muh:";
inAppSection = false;
continue;
}
if (inMuhSection && indentation === 2) {
inAppSection = trimmedLine === "app:";
continue;
}
if (inMuhSection && inAppSection && indentation === 4 && trimmedLine.startsWith("version:")) {
const version = trimmedLine.slice("version:".length).trim().replace(/^['"]|['"]$/g, "");
if (/^\d+\.\d+\.\d+$/.test(version)) {
return version;
}
throw new Error(`Ungueltige Versionsnummer in ${APPLICATION_CONFIG_PATH}: ${version}`);
}
}
throw new Error(`muh.app.version konnte nicht aus ${APPLICATION_CONFIG_PATH} ermittelt werden.`);
throw new Error(`Version konnte nicht aus ${POM_PATH} ermittelt werden.`);
}
export default defineConfig({
plugins: [react()],