chore: version 0.9.4 release
This commit is contained in:
@@ -4,7 +4,7 @@ WORKDIR /build/frontend
|
|||||||
ARG VITE_API_URL=/api
|
ARG VITE_API_URL=/api
|
||||||
ENV VITE_API_URL=${VITE_API_URL}
|
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 ./
|
COPY frontend/package*.json ./
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<groupId>de.svencarstensen</groupId>
|
<groupId>de.svencarstensen</groupId>
|
||||||
<artifactId>muh-backend</artifactId>
|
<artifactId>muh-backend</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.9.4</version>
|
||||||
<name>muh-backend</name>
|
<name>muh-backend</name>
|
||||||
<description>MUH application backend</description>
|
<description>MUH application backend</description>
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ spring:
|
|||||||
|
|
||||||
muh:
|
muh:
|
||||||
app:
|
app:
|
||||||
version: 0.9.3
|
version: '@project.version@'
|
||||||
cors:
|
cors:
|
||||||
allowed-origins: ${MUH_ALLOWED_ORIGINS:http://localhost:5173,http://localhost:3000}
|
allowed-origins: ${MUH_ALLOWED_ORIGINS:http://localhost:5173,http://localhost:3000}
|
||||||
security:
|
security:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ set -euo pipefail
|
|||||||
|
|
||||||
readonly SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
readonly SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
readonly REGISTRY_IMAGE="registry.assecutor.org/muh"
|
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() {
|
usage() {
|
||||||
cat <<'EOF'
|
cat <<'EOF'
|
||||||
@@ -20,7 +20,7 @@ Voraussetzungen:
|
|||||||
- Login zur Registry wurde bereits ausgeführt:
|
- Login zur Registry wurde bereits ausgeführt:
|
||||||
docker login registry.assecutor.org
|
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.
|
Optional kann VITE_API_URL als Umgebungsvariable gesetzt werden.
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@@ -35,39 +35,13 @@ require_command() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resolve_app_version() {
|
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
|
local version
|
||||||
version="$(
|
version="$(sed -n '/<parent>/,/<\/parent>/!{ s/.*<version>\(.*\)<\/version>.*/\1/p; }' "${POM_FILE}" | head -1)"
|
||||||
awk '
|
|
||||||
$0 ~ /^muh:[[:space:]]*$/ {
|
|
||||||
in_muh = 1
|
|
||||||
in_app = 0
|
|
||||||
next
|
|
||||||
}
|
|
||||||
|
|
||||||
in_muh && $0 ~ /^[^[:space:]]/ {
|
[[ -n "${version}" ]] || fail "Version konnte nicht aus ${POM_FILE} ermittelt werden."
|
||||||
in_muh = 0
|
[[ "${version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || fail "Version in ${POM_FILE} muss das Format x.y.z haben."
|
||||||
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."
|
|
||||||
echo "${version}"
|
echo "${version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ export default function UserManagementPage() {
|
|||||||
if (!userToUpdate) return;
|
if (!userToUpdate) return;
|
||||||
|
|
||||||
await apiPost("/portal/users", {
|
await apiPost("/portal/users", {
|
||||||
id: userId,
|
...userToUpdate,
|
||||||
active: newStatus,
|
active: newStatus,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -4,35 +4,17 @@ import { fileURLToPath } from "node:url";
|
|||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
const CONFIG_DIR = path.dirname(fileURLToPath(import.meta.url));
|
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() {
|
function resolveAppVersion() {
|
||||||
const lines = fs.readFileSync(APPLICATION_CONFIG_PATH, "utf8").split(/\r?\n/);
|
const content = fs.readFileSync(POM_PATH, "utf8");
|
||||||
let inMuhSection = false;
|
const parentRange = content.indexOf("<parent>");
|
||||||
let inAppSection = false;
|
const parentEnd = content.indexOf("</parent>");
|
||||||
for (const line of lines) {
|
const withoutParent = content.slice(0, parentRange) + content.slice(parentEnd + "</parent>".length);
|
||||||
const trimmedLine = line.trim();
|
const match = withoutParent.match(/<version>(\d+\.\d+\.\d+)<\/version>/);
|
||||||
if (!trimmedLine || trimmedLine.startsWith("#")) {
|
if (match) {
|
||||||
continue;
|
return match[1];
|
||||||
}
|
}
|
||||||
const indentation = line.length - line.trimStart().length;
|
throw new Error(`Version konnte nicht aus ${POM_PATH} ermittelt werden.`);
|
||||||
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.`);
|
|
||||||
}
|
}
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
|||||||
Reference in New Issue
Block a user