You've already forked snikket-web-portal
Automatically determine version from build info or git
This commit is contained in:
@@ -37,5 +37,7 @@ ENV SNIKKET_WEB_PROSODY_ENDPOINT=http://127.0.0.1:5280/
|
|||||||
|
|
||||||
HEALTHCHECK CMD nc -zv ${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_INTERFACE:-127.0.0.1} ${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT:-5765}
|
HEALTHCHECK CMD nc -zv ${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_INTERFACE:-127.0.0.1} ${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT:-5765}
|
||||||
|
|
||||||
|
RUN echo "$BUILD_SERIES $BUILD_ID" > /opt/snikket-web-portal/.app_version
|
||||||
|
|
||||||
ADD docker/entrypoint.sh /entrypoint.sh
|
ADD docker/entrypoint.sh /entrypoint.sh
|
||||||
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]
|
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ from quart import (
|
|||||||
import environ
|
import environ
|
||||||
|
|
||||||
from . import colour, infra
|
from . import colour, infra
|
||||||
from ._version import version, version_info # noqa:F401
|
from ._version import version # noqa:F401
|
||||||
|
|
||||||
|
|
||||||
async def proc() -> typing.Dict[str, typing.Any]:
|
async def proc() -> typing.Dict[str, typing.Any]:
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
version_info = (0, 2, 1, None)
|
import os
|
||||||
version = (
|
import subprocess
|
||||||
".".join(map(str, version_info[:3])) +
|
|
||||||
(f"-{version_info[3]}" if version_info[3] else "")
|
version = "(unknown)"
|
||||||
)
|
|
||||||
|
if os.path.exists(".app_version"):
|
||||||
|
with open(".app_version") as f:
|
||||||
|
version = f.read().strip()
|
||||||
|
elif os.path.exists(".git"):
|
||||||
|
try:
|
||||||
|
version = subprocess.check_output([
|
||||||
|
"git", "describe", "--always"
|
||||||
|
]).strip().decode("utf8")
|
||||||
|
except OSError:
|
||||||
|
version = "dev (unknown)"
|
||||||
|
|||||||
Reference in New Issue
Block a user