Fix: Using dsh and glm5.3-flash
This commit is contained in:
+15
-5
@@ -69,19 +69,30 @@ WORKDIR /app/
|
|||||||
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment
|
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment
|
||||||
ENV PATH="/app/.venv/bin:$PATH"
|
ENV PATH="/app/.venv/bin:$PATH"
|
||||||
|
|
||||||
# Pass version from Makefile to setuptools-scm since .git is not in context
|
# Pass the version from the Makefile. The build context has no usable .git
|
||||||
ARG SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BREWMAN
|
# (a git-URL build is a tag-less shallow clone and git is not installed), so
|
||||||
ENV SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BREWMAN=$SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BREWMAN
|
# hatch-vcs cannot discover the version itself. hatch-vcs calls
|
||||||
|
# setuptools_scm without a dist name, so only the generic
|
||||||
|
# SETUPTOOLS_SCM_PRETEND_VERSION is honored - the
|
||||||
|
# SETUPTOOLS_SCM_PRETEND_VERSION_FOR_<NAME> variant is silently ignored.
|
||||||
|
ARG SETUPTOOLS_SCM_PRETEND_VERSION
|
||||||
|
ENV SETUPTOOLS_SCM_PRETEND_VERSION=$SETUPTOOLS_SCM_PRETEND_VERSION
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
|
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
|
||||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
--mount=type=bind,source=brewman/uv.lock,target=uv.lock \
|
--mount=type=bind,source=brewman/uv.lock,target=uv.lock \
|
||||||
--mount=type=bind,source=brewman/pyproject.toml,target=pyproject.toml \
|
--mount=type=bind,source=brewman/pyproject.toml,target=pyproject.toml \
|
||||||
--mount=source=.git,target=.git,type=bind \
|
|
||||||
uv sync --locked --no-install-project
|
uv sync --locked --no-install-project
|
||||||
|
|
||||||
COPY /brewman ./
|
COPY /brewman ./
|
||||||
|
|
||||||
|
# hatch-vcs generates _version.py only inside uv's isolated wheel build, so
|
||||||
|
# the source tree copied here lacks it. Write it ourselves (from the same
|
||||||
|
# build arg) so importing brewman from /app works identically to the
|
||||||
|
# installed wheel package in .venv.
|
||||||
|
RUN printf '__version__ = version = "%s"\n' "$SETUPTOOLS_SCM_PRETEND_VERSION" > brewman/_version.py
|
||||||
|
|
||||||
COPY --from=builder /frontend/browser /app/frontend
|
COPY --from=builder /frontend/browser /app/frontend
|
||||||
|
|
||||||
# Sync the project
|
# Sync the project
|
||||||
@@ -89,7 +100,6 @@ COPY --from=builder /frontend/browser /app/frontend
|
|||||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
--mount=type=bind,source=brewman/uv.lock,target=uv.lock \
|
--mount=type=bind,source=brewman/uv.lock,target=uv.lock \
|
||||||
--mount=type=bind,source=brewman/pyproject.toml,target=pyproject.toml \
|
--mount=type=bind,source=brewman/pyproject.toml,target=pyproject.toml \
|
||||||
--mount=source=.git,target=.git,type=bind \
|
|
||||||
uv sync --locked --no-editable
|
uv sync --locked --no-editable
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
.PHONY: build-production
|
.PHONY: build-production
|
||||||
build-production: ## Build the production container image. Usage: make build-production TAG=15.4.0
|
build-production: ## Build the production container image. Usage: make build-production TAG=15.4.0
|
||||||
|
@test -n "$(TAG)" || { echo "Usage: make build-production TAG=15.4.0" >&2; exit 1; }
|
||||||
@echo "Building image..."
|
@echo "Building image..."
|
||||||
@podman manifest rm registry.tanshu.com/brewman:latest 2>/dev/null || true
|
@podman manifest rm registry.tanshu.com/brewman:latest 2>/dev/null || true
|
||||||
@podman build \
|
@podman build \
|
||||||
--platform linux/amd64,linux/arm64 \
|
--platform linux/amd64,linux/arm64 \
|
||||||
--manifest registry.tanshu.com/brewman:latest \
|
--manifest registry.tanshu.com/brewman:latest \
|
||||||
--pull \
|
--pull \
|
||||||
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BREWMAN=$(TAG) \
|
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION=$(TAG) \
|
||||||
https://git.tanshu.com/tanshu/brewman.git#v$(TAG)
|
https://git.tanshu.com/tanshu/brewman.git#v$(TAG)
|
||||||
|
|
||||||
@echo "Pushing manifests..."
|
@echo "Pushing manifests..."
|
||||||
@@ -15,22 +16,25 @@ build-production: ## Build the production container image. Usage: make build-pro
|
|||||||
|
|
||||||
.PHONY: build-check
|
.PHONY: build-check
|
||||||
build-check: ## Multi-arch build without push (compile check). Usage: make build-check TAG=15.4.0
|
build-check: ## Multi-arch build without push (compile check). Usage: make build-check TAG=15.4.0
|
||||||
|
@test -n "$(TAG)" || { echo "Usage: make build-check TAG=15.4.0" >&2; exit 1; }
|
||||||
@echo "Building image..."
|
@echo "Building image..."
|
||||||
@podman manifest rm brewman:test 2>/dev/null || true
|
@podman manifest rm brewman:test 2>/dev/null || true
|
||||||
@podman build \
|
@podman build \
|
||||||
--platform linux/amd64,linux/arm64 \
|
--platform linux/amd64,linux/arm64 \
|
||||||
--manifest brewman:test \
|
--manifest brewman:test \
|
||||||
--pull \
|
--pull \
|
||||||
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BREWMAN=$(TAG) \
|
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION=$(TAG) \
|
||||||
https://git.tanshu.com/tanshu/brewman.git#v$(TAG)
|
https://git.tanshu.com/tanshu/brewman.git#v$(TAG)
|
||||||
|
|
||||||
.PHONY: build-check-local
|
.PHONY: build-check-local
|
||||||
build-check-local: ## Multi-arch build without push (compile check). Usage: make build-check TAG=15.4.0
|
# Defaults the version when built without a tag; an explicit TAG still wins.
|
||||||
|
build-check-local: TAG = 0.0.0
|
||||||
|
build-check-local: ## Single-arch build without push (compile check). Usage: make build-check-local [TAG=15.4.0]
|
||||||
@echo "Building image..."
|
@echo "Building image..."
|
||||||
@podman manifest rm brewman:test 2>/dev/null || true
|
@podman manifest rm brewman:test 2>/dev/null || true
|
||||||
@podman build \
|
@podman build \
|
||||||
--platform linux/amd64 \
|
--platform linux/amd64 \
|
||||||
--manifest brewman:test \
|
--manifest brewman:test \
|
||||||
--no-cache \
|
--no-cache \
|
||||||
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BREWMAN=$(TAG) \
|
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION=$(TAG) \
|
||||||
.
|
.
|
||||||
|
|||||||
Reference in New Issue
Block a user