diff --git a/Dockerfile b/Dockerfile index 9032f71..863b74b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,10 @@ RUN pip install --no-cache-dir -r requirements.txt \ && rm -rf /var/lib/apt/lists/* # Copy application code -# Note: Run 'python -m app.version freeze' before build to include version info +# Note: Run 'python -m app.version freeze' before build to include version info. +# VERSION holds the release number and is read at /app/VERSION when no frozen +# version file is present (e.g. a plain 'docker compose build' during dev). +COPY VERSION ./ COPY app/ ./app/ # Expose Flask port diff --git a/README.md b/README.md index a933bb9..a2cf27d 100644 --- a/README.md +++ b/README.md @@ -335,7 +335,7 @@ python3 -m app.version freeze docker compose up -d --build ``` -The `python3 -m app.version freeze` command captures the current Git version (date + commit hash) for display in the app menu. +The `python3 -m app.version freeze` command captures the current Git build (date + commit hash) for display in the app menu, underneath the release number from the `VERSION` file. Released versions are tagged `v` and published at [Releases](https://github.com/MarekWo/mc-webui/releases); see [Versioning & Releases](docs/architecture.md#versioning--releases) for how a release is cut. ### Testing experimental features diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..7ec1d6d --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +2.1.0 diff --git a/app/main.py b/app/main.py index dff6819..1a1a719 100644 --- a/app/main.py +++ b/app/main.py @@ -22,7 +22,7 @@ from app.log_handler import MemoryLogHandler from app.observer import ObserverManager from app.routes.views import views_bp from app.routes.api import api_bp -from app.version import VERSION_STRING, GIT_BRANCH +from app.version import RELEASE_VERSION, VERSION_STRING, GIT_BRANCH # Configure logging logging.basicConfig( @@ -230,6 +230,7 @@ def create_app(): @app.context_processor def inject_globals(): return { + 'release': RELEASE_VERSION, 'version': VERSION_STRING, 'git_branch': GIT_BRANCH, 'transport_type': config.transport_type, diff --git a/app/routes/api.py b/app/routes/api.py index d61f92a..fad6b6e 100644 --- a/app/routes/api.py +++ b/app/routes/api.py @@ -4962,14 +4962,19 @@ def get_version(): JSON with version info: { "success": true, + "release": "2.1.0", "version": "2025.01.18+576c8ca9", "docker_tag": "2025.01.18-576c8ca9", "branch": "dev" } + + 'release' is the human-facing release number; 'version' stays the exact + build and remains what the update poller compares. """ - from app.version import VERSION_STRING, DOCKER_TAG, GIT_BRANCH + from app.version import RELEASE_VERSION, VERSION_STRING, DOCKER_TAG, GIT_BRANCH return jsonify({ 'success': True, + 'release': RELEASE_VERSION, 'version': VERSION_STRING, 'docker_tag': DOCKER_TAG, 'branch': GIT_BRANCH diff --git a/app/templates/base.html b/app/templates/base.html index b2ab716..742d3a2 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -96,8 +96,11 @@
- {{ version }} + {{ release }} {{ git_branch }} + + {{ version }}