Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68ccc25652 | ||
|
|
c32db91535 | ||
|
|
79cdf83c9e | ||
|
|
5b691a577b | ||
|
|
aeee758718 | ||
|
|
3dfb0a2b2f | ||
|
|
7813ffbc66 |
@@ -1,3 +1,7 @@
|
|||||||
|
# Ignore Git metadata
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
|
||||||
# IDEs & System Files
|
# IDEs & System Files
|
||||||
.idea/
|
.idea/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
@@ -52,3 +56,6 @@ yarn-error.log*
|
|||||||
# Ignore Pyright-generated stubs
|
# Ignore Pyright-generated stubs
|
||||||
*.pyi
|
*.pyi
|
||||||
typings/
|
typings/
|
||||||
|
|
||||||
|
# AI Coding agents temp files
|
||||||
|
.scratch/
|
||||||
Vendored
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"type": "npm",
|
"type": "npm",
|
||||||
"script": "start -- --port 4200",
|
"script": "start",
|
||||||
"isBackground": true,
|
"isBackground": true,
|
||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}/overlord"
|
"cwd": "${workspaceFolder}/overlord"
|
||||||
|
|||||||
+20
-3
@@ -5,7 +5,7 @@
|
|||||||
# builds (podman builds all --platform targets concurrently).
|
# builds (podman builds all --platform targets concurrently).
|
||||||
# Declare the automatic build arguments
|
# Declare the automatic build arguments
|
||||||
ARG BUILDPLATFORM
|
ARG BUILDPLATFORM
|
||||||
FROM --platform=$BUILDPLATFORM node:lts-trixie-slim AS base
|
FROM --platform=$BUILDPLATFORM docker.io/library/node:lts-trixie-slim AS base
|
||||||
|
|
||||||
# Install dependencies only when needed
|
# Install dependencies only when needed
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
@@ -36,7 +36,7 @@ RUN \
|
|||||||
else echo "Lockfile not found." && exit 1; \
|
else echo "Lockfile not found." && exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FROM python:3.14-slim AS runner
|
FROM docker.io/library/python:3.14-slim AS runner
|
||||||
LABEL maintainer="Amritanshu <docker@tanshu.com>"
|
LABEL maintainer="Amritanshu <docker@tanshu.com>"
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
@@ -69,7 +69,6 @@ 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"
|
||||||
|
|
||||||
|
|
||||||
# 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 \
|
||||||
@@ -78,11 +77,29 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
|||||||
uv sync --locked --no-install-project
|
uv sync --locked --no-install-project
|
||||||
|
|
||||||
COPY /brewman ./
|
COPY /brewman ./
|
||||||
|
|
||||||
|
# Pass the version from the Makefile. The build context has no usable .git
|
||||||
|
# (git archive stream / shallow clone lacks git metadata), so
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# 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
|
||||||
# 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/pyproject.toml,target=pyproject.toml \
|
||||||
uv sync --locked --no-editable
|
uv sync --locked --no-editable
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
@@ -1,17 +1,15 @@
|
|||||||
.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
|
||||||
@echo "Cloning repository..."
|
@test -n "$(TAG)" || { echo "Usage: make build-production TAG=15.4.0" >&2; exit 1; }
|
||||||
@rm -rf .tmp-brewman
|
|
||||||
@git clone --depth 1 $(if $(TAG),--branch v$(TAG)) git@git.tanshu.com:tanshu/brewman.git .tmp-brewman
|
|
||||||
|
|
||||||
@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 \
|
||||||
|
--format docker \
|
||||||
--platform linux/amd64,linux/arm64 \
|
--platform linux/amd64,linux/arm64 \
|
||||||
--manifest registry.tanshu.com/brewman:latest \
|
--manifest registry.tanshu.com/brewman:latest \
|
||||||
--pull \
|
--pull \
|
||||||
.tmp-brewman || (rm -rf .tmp-brewman && exit 1)
|
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION=$(TAG) \
|
||||||
@rm -rf .tmp-brewman
|
https://git.tanshu.com/tanshu/brewman.git#v$(TAG)
|
||||||
|
|
||||||
@echo "Pushing manifests..."
|
@echo "Pushing manifests..."
|
||||||
@podman manifest push --all registry.tanshu.com/brewman:latest docker://registry.tanshu.com/brewman:latest
|
@podman manifest push --all registry.tanshu.com/brewman:latest docker://registry.tanshu.com/brewman:latest
|
||||||
@@ -19,15 +17,27 @@ 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
|
||||||
@echo "Cloning repository..."
|
@test -n "$(TAG)" || { echo "Usage: make build-check TAG=15.4.0" >&2; exit 1; }
|
||||||
@rm -rf .tmp-brewman
|
|
||||||
@git clone --depth 1 $(if $(TAG),--branch v$(TAG)) git@git.tanshu.com:tanshu/brewman.git .tmp-brewman
|
|
||||||
|
|
||||||
@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 \
|
||||||
|
--format docker \
|
||||||
--platform linux/amd64,linux/arm64 \
|
--platform linux/amd64,linux/arm64 \
|
||||||
--manifest brewman:test \
|
--manifest brewman:test \
|
||||||
--pull \
|
--pull \
|
||||||
.tmp-brewman || (rm -rf .tmp-brewman && exit 1)
|
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION=$(TAG) \
|
||||||
@rm -rf .tmp-brewman
|
https://git.tanshu.com/tanshu/brewman.git#v$(TAG)
|
||||||
|
|
||||||
|
.PHONY: build-check-local
|
||||||
|
# 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..."
|
||||||
|
@podman manifest rm brewman:test 2>/dev/null || true
|
||||||
|
@podman build \
|
||||||
|
--format docker \
|
||||||
|
--platform linux/amd64 \
|
||||||
|
--manifest brewman:test \
|
||||||
|
--no-cache \
|
||||||
|
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION=$(TAG) \
|
||||||
|
.
|
||||||
|
|||||||
@@ -32,6 +32,9 @@
|
|||||||
env_file: "/var/lib/{{ host_directory }}/.env"
|
env_file: "/var/lib/{{ host_directory }}/.env"
|
||||||
networks:
|
networks:
|
||||||
- name: "brewman_{{ instance }}_net"
|
- name: "brewman_{{ instance }}_net"
|
||||||
# volumes:
|
healthcheck:
|
||||||
# - "/var/lib/{{ host_directory }}/frontend:/frontend"
|
test: ["CMD-SHELL", "curl -fsS http://localhost/health || kill -s 15 1"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 5s
|
||||||
|
start_period: 30s
|
||||||
|
retries: 3
|
||||||
|
|||||||
@@ -14,7 +14,10 @@ def report_start_date(request: Request, s: str | date | None = None) -> date:
|
|||||||
return d
|
return d
|
||||||
if "start" not in session:
|
if "start" not in session:
|
||||||
session["start"] = get_first_day(date.today()).isoformat()
|
session["start"] = get_first_day(date.today()).isoformat()
|
||||||
return date.fromisoformat(session["start"])
|
try:
|
||||||
|
return date.fromisoformat(session["start"])
|
||||||
|
except ValueError:
|
||||||
|
return get_first_day(date.today())
|
||||||
|
|
||||||
|
|
||||||
def report_finish_date(request: Request, f: str | date | None = None) -> date:
|
def report_finish_date(request: Request, f: str | date | None = None) -> date:
|
||||||
@@ -28,7 +31,10 @@ def report_finish_date(request: Request, f: str | date | None = None) -> date:
|
|||||||
return d
|
return d
|
||||||
if "finish" not in session:
|
if "finish" not in session:
|
||||||
session["finish"] = get_last_day(date.today()).isoformat()
|
session["finish"] = get_last_day(date.today()).isoformat()
|
||||||
return date.fromisoformat(session["finish"])
|
try:
|
||||||
|
return date.fromisoformat(session["finish"])
|
||||||
|
except ValueError:
|
||||||
|
return get_last_day(date.today())
|
||||||
|
|
||||||
|
|
||||||
def report_date(request: Request, d: str | date | None = None) -> date:
|
def report_date(request: Request, d: str | date | None = None) -> date:
|
||||||
@@ -42,7 +48,10 @@ def report_date(request: Request, d: str | date | None = None) -> date:
|
|||||||
return parsed_date
|
return parsed_date
|
||||||
if "date" not in session:
|
if "date" not in session:
|
||||||
session["date"] = get_last_day(date.today()).isoformat()
|
session["date"] = get_last_day(date.today()).isoformat()
|
||||||
return date.fromisoformat(session["date"])
|
try:
|
||||||
|
return date.fromisoformat(session["date"])
|
||||||
|
except ValueError:
|
||||||
|
return get_last_day(date.today())
|
||||||
|
|
||||||
|
|
||||||
def get_first_day(dt: date, d_years: int = 0, d_months: int = 0) -> date:
|
def get_first_day(dt: date, d_years: int = 0, d_months: int = 0) -> date:
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
/>
|
/>
|
||||||
<mat-autocomplete #auto="matAutocomplete" autoActiveFirstOption [displayWith]="displayFn">
|
<mat-autocomplete #auto="matAutocomplete" autoActiveFirstOption [displayWith]="displayFn">
|
||||||
@for (account of accounts(); track account) {
|
@for (account of accounts(); track account.id) {
|
||||||
<mat-option [value]="account">{{ account.name }}</mat-option>
|
<mat-option [value]="account">{{ account.name }}</mat-option>
|
||||||
}
|
}
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
|
|||||||
@@ -26,20 +26,16 @@
|
|||||||
<div class="row-container">
|
<div class="row-container">
|
||||||
<mat-form-field class="flex-auto basis-4-5">
|
<mat-form-field class="flex-auto basis-4-5">
|
||||||
<mat-label>Product</mat-label>
|
<mat-label>Product</mat-label>
|
||||||
<input
|
<input type="text" matInput [matAutocomplete]="auto" [formField]="form.product" autocomplete="off" />
|
||||||
type="text"
|
|
||||||
matInput
|
|
||||||
#productElement
|
|
||||||
[matAutocomplete]="auto"
|
|
||||||
[formField]="form.product"
|
|
||||||
autocomplete="off"
|
|
||||||
/>
|
|
||||||
<mat-autocomplete
|
<mat-autocomplete
|
||||||
#auto="matAutocomplete"
|
#auto="matAutocomplete"
|
||||||
autoActiveFirstOption
|
autoActiveFirstOption
|
||||||
[displayWith]="displayFn"
|
[displayWith]="displayFn"
|
||||||
(optionSelected)="selected($event)"
|
(optionSelected)="selected($event)"
|
||||||
>
|
>
|
||||||
|
@for (product of products(); track product.id) {
|
||||||
|
<mat-option [value]="product">{{ product.name }}</mat-option>
|
||||||
|
}
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<button mat-raised-button type="submit" class="flex-auto basis-1-5" color="primary">Show</button>
|
<button mat-raised-button type="submit" class="flex-auto basis-1-5" color="primary">Show</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user