Refactor: Oddělení business logiky + inline editor
Some checks failed
Build & Push Docker / build (push) Has been cancelled
Some checks failed
Build & Push Docker / build (push) Has been cancelled
- Nový modul scenar/core.py (491 řádků čisté logiky)
- Refactored cgi-bin/scenar.py (450 řádků CGI wrapper)
- Inline editor s JavaScript row managementem
- Custom exceptions (ScenarsError, ValidationError, TemplateError)
- Kompletní test coverage (10 testů, všechny ✅)
- Fixed Dockerfile (COPY scenar/, requirements.txt)
- Fixed requirements.txt (openpyxl==3.1.5)
- Fixed pytest.ini (pythonpath = .)
- Nové testy: test_http_inline.py, test_inline_builder.py
- HTTP testy označeny jako @pytest.mark.integration
- Build script: scripts/build_image.sh
- Dokumentace: COMPLETION.md
This commit is contained in:
20
scripts/build_image.sh
Executable file
20
scripts/build_image.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
# Usage: ./scripts/build_image.sh [image_tag]
|
||||
IMAGE_TAG=${1:-scenar-creator:latest}
|
||||
|
||||
# Ensure podman machine is running (macOS/Windows)
|
||||
if ! podman machine info >/dev/null 2>&1; then
|
||||
echo "Starting podman machine..."
|
||||
podman machine start || true
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
echo "Building image '$IMAGE_TAG' from $REPO_ROOT..."
|
||||
|
||||
cd "$REPO_ROOT"
|
||||
podman build -t "$IMAGE_TAG" .
|
||||
|
||||
echo "Image '$IMAGE_TAG' built successfully."
|
||||
echo "Start container with: ./scripts/start_scenar.sh $IMAGE_TAG"
|
||||
9
scripts/start_scenar.sh
Normal file → Executable file
9
scripts/start_scenar.sh
Normal file → Executable file
@@ -5,6 +5,13 @@ IMAGE=${1:-scenar-creator:latest}
|
||||
NAME=${2:-scenar-creator}
|
||||
PORT=${3:-8080}
|
||||
|
||||
# Ensure podman machine is running (macOS/Windows)
|
||||
if ! podman machine info >/dev/null 2>&1; then
|
||||
echo "Starting podman machine..."
|
||||
podman machine start || true
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
echo "Starting container '$NAME' from image '$IMAGE' on port $PORT..."
|
||||
docker run -d --name "$NAME" -p "$PORT:8080" "$IMAGE"
|
||||
podman run -d --name "$NAME" -p "$PORT:8080" "$IMAGE"
|
||||
echo "Container started."
|
||||
|
||||
2
scripts/stop_scenar.sh
Normal file → Executable file
2
scripts/stop_scenar.sh
Normal file → Executable file
@@ -4,5 +4,5 @@ set -eu
|
||||
NAME=${1:-scenar-creator}
|
||||
|
||||
echo "Stopping and removing container '$NAME'..."
|
||||
docker rm -f "$NAME" >/dev/null 2>&1 || true
|
||||
podman rm -f "$NAME" >/dev/null 2>&1 || true
|
||||
echo "Container removed (if it existed)."
|
||||
|
||||
Reference in New Issue
Block a user