Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80addc5b20 | ||
|
|
68ccc25652 | ||
|
|
c32db91535 | ||
|
|
79cdf83c9e | ||
|
|
5b691a577b | ||
|
|
aeee758718 | ||
|
|
3dfb0a2b2f | ||
|
|
7813ffbc66 | ||
|
|
d28918992a | ||
|
|
e06e077ebe | ||
|
|
d288523d4e |
+10
-1
@@ -1,3 +1,7 @@
|
|||||||
|
# Ignore Git metadata
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
|
||||||
# IDEs & System Files
|
# IDEs & System Files
|
||||||
.idea/
|
.idea/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
@@ -34,6 +38,8 @@ node_modules/
|
|||||||
**/.ruff_cache/
|
**/.ruff_cache/
|
||||||
.pytest_cache/
|
.pytest_cache/
|
||||||
**/.pytest_cache/
|
**/.pytest_cache/
|
||||||
|
# Generated by hatch-vcs at install time
|
||||||
|
brewman/brewman/_version.py
|
||||||
|
|
||||||
# Testing & Coverage
|
# Testing & Coverage
|
||||||
coverage/
|
coverage/
|
||||||
@@ -49,4 +55,7 @@ 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"
|
||||||
|
|||||||
+26
-4
@@ -1,4 +1,11 @@
|
|||||||
FROM node:lts-trixie-slim AS base
|
# Pin the Node stages to the builder's own platform ($BUILDPLATFORM).
|
||||||
|
# The Angular build output is platform-independent static files, so there is
|
||||||
|
# no need to run yarn/ng build under qemu emulation for linux/arm64 - doing
|
||||||
|
# so is slow and memory hungry and can OOM the machine during multi-arch
|
||||||
|
# builds (podman builds all --platform targets concurrently).
|
||||||
|
# Declare the automatic build arguments
|
||||||
|
ARG BUILDPLATFORM
|
||||||
|
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
|
||||||
@@ -29,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 \
|
||||||
@@ -70,6 +77,22 @@ 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
|
||||||
@@ -77,9 +100,8 @@ 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 \
|
||||||
uv sync --locked
|
uv sync --locked --no-editable
|
||||||
|
|
||||||
ENV PYTHONPATH=/app
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
RUN chmod 777 /app/docker-entrypoint.sh \
|
RUN chmod 777 /app/docker-entrypoint.sh \
|
||||||
|
|||||||
@@ -1,27 +1,40 @@
|
|||||||
.PHONY: build-production
|
.PHONY: build-production
|
||||||
build-production: ## Build the production container image.
|
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..."
|
||||||
@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 \
|
@git archive --format=tar "v$(TAG)" | podman build \
|
||||||
--platform linux/amd64,linux/arm64 \
|
--platform linux/amd64,linux/arm64 \
|
||||||
--manifest registry.tanshu.com/brewman:latest \
|
--manifest registry.tanshu.com/brewman:latest \
|
||||||
git@git.tanshu.com:tanshu/brewman.git$(if $(TAG),#v$(TAG))
|
--pull \
|
||||||
|
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION=$(TAG) \
|
||||||
|
-
|
||||||
|
|
||||||
|
@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
|
||||||
$(if $(TAG),@podman manifest push --all registry.tanshu.com/brewman:latest docker://registry.tanshu.com/brewman:$(TAG))
|
$(if $(TAG),@podman manifest push --all registry.tanshu.com/brewman:latest docker://registry.tanshu.com/brewman:$(TAG))
|
||||||
|
|
||||||
.PHONY: build-check
|
.PHONY: build-check
|
||||||
build-check: ## Multi-arch build without push (compile check)
|
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..."
|
||||||
@podman manifest rm brewman:test 2>/dev/null || true
|
@podman manifest rm brewman:test 2>/dev/null || true
|
||||||
@podman build \
|
@git archive --format=tar "v$(TAG)" | podman build \
|
||||||
--platform linux/amd64,linux/arm64 \
|
--platform linux/amd64,linux/arm64 \
|
||||||
--manifest brewman:test \
|
--manifest brewman:test \
|
||||||
--pull \
|
--pull \
|
||||||
git@git.tanshu.com:tanshu/brewman.git
|
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION=$(TAG) \
|
||||||
|
|
||||||
.PHONY: build-check-local
|
|
||||||
build-check-local: ## Local build without push (compile check)
|
|
||||||
@git archive --format=tar HEAD | podman build \
|
|
||||||
--platform linux/amd64 \
|
|
||||||
--tag brewman:test \
|
|
||||||
--pull \
|
|
||||||
-
|
-
|
||||||
|
|
||||||
|
.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 \
|
||||||
|
--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
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
__version__ = "15.3.1"
|
|
||||||
@@ -18,7 +18,7 @@ from fastapi.security import OAuth2PasswordRequestForm
|
|||||||
from sqlalchemy import delete, or_, select
|
from sqlalchemy import delete, or_, select
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
|
|
||||||
from .. import __version__
|
from .._version import __version__
|
||||||
from ..core.config import settings
|
from ..core.config import settings
|
||||||
from ..core.security import (
|
from ..core.security import (
|
||||||
Token,
|
Token,
|
||||||
@@ -120,7 +120,7 @@ async def login_for_access_token(
|
|||||||
"scopes": ["authenticated"] + perm_scopes,
|
"scopes": ["authenticated"] + perm_scopes,
|
||||||
"userId": str(user.id),
|
"userId": str(user.id),
|
||||||
"lockedOut": user.locked_out,
|
"lockedOut": user.locked_out,
|
||||||
"ver": __version__.__version__,
|
"ver": __version__,
|
||||||
},
|
},
|
||||||
expires_delta=access_token_expires,
|
expires_delta=access_token_expires,
|
||||||
)
|
)
|
||||||
@@ -136,7 +136,7 @@ async def refresh_token(user: UserToken = Security(get_current_active_user)) ->
|
|||||||
"scopes": user.permissions,
|
"scopes": user.permissions,
|
||||||
"userId": str(user.id_),
|
"userId": str(user.id_),
|
||||||
"lockedOut": user.locked_out,
|
"lockedOut": user.locked_out,
|
||||||
"ver": __version__.__version__,
|
"ver": __version__,
|
||||||
},
|
},
|
||||||
expires_delta=access_token_expires,
|
expires_delta=access_token_expires,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "brewman"
|
name = "brewman"
|
||||||
version = "15.3.1"
|
|
||||||
description = "Accounting plus inventory management for a restaurant."
|
description = "Accounting plus inventory management for a restaurant."
|
||||||
requires-python = ">=3.14"
|
requires-python = ">=3.14"
|
||||||
authors = [{ name = "tanshu", email = "git@tanshu.com" }]
|
authors = [{ name = "tanshu", email = "git@tanshu.com" }]
|
||||||
@@ -24,6 +23,7 @@ dependencies = [
|
|||||||
"sqlalchemy>=2.0.52",
|
"sqlalchemy>=2.0.52",
|
||||||
"uvicorn[standard]>=0.52.4",
|
"uvicorn[standard]>=0.52.4",
|
||||||
]
|
]
|
||||||
|
dynamic = ["version"]
|
||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
dev = [
|
dev = [
|
||||||
@@ -37,9 +37,15 @@ dev = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["hatchling"]
|
requires = ["hatch-vcs", "hatchling"]
|
||||||
build-backend = "hatchling.build"
|
build-backend = "hatchling.build"
|
||||||
|
|
||||||
|
[tool.hatch.version]
|
||||||
|
source = "vcs"
|
||||||
|
|
||||||
|
[tool.hatch.build.hooks.vcs]
|
||||||
|
version-file = "brewman/_version.py"
|
||||||
|
|
||||||
[tool.mypy]
|
[tool.mypy]
|
||||||
# --- Strictness ---
|
# --- Strictness ---
|
||||||
strict = true
|
strict = true
|
||||||
|
|||||||
Generated
-1
@@ -211,7 +211,6 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brewman"
|
name = "brewman"
|
||||||
version = "15.3.1"
|
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "alembic" },
|
{ name = "alembic" },
|
||||||
|
|||||||
@@ -3,14 +3,41 @@ set -euo pipefail
|
|||||||
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P )
|
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P )
|
||||||
cd "$parent_path" || exit
|
cd "$parent_path" || exit
|
||||||
|
|
||||||
#./lint.sh
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "Usage: $0 <major|minor|patch|version_string>"
|
||||||
if [ 1 -eq "$#" ]
|
exit 1
|
||||||
then
|
|
||||||
./version_bump.sh "$1"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
current_version=$(grep -m 1 '^version = ' brewman/pyproject.toml | sed -E 's/version = "([^"]+)"/\1/')
|
if git describe --exact-match --tags HEAD >/dev/null 2>&1; then
|
||||||
make build-production TAG="$current_version"
|
existing_tag=$(git describe --exact-match --tags HEAD)
|
||||||
|
echo "Current commit is already tagged with $existing_tag. Skipping tag creation."
|
||||||
|
new_version=${existing_tag#v}
|
||||||
|
else
|
||||||
|
current_version=$(git describe --tags --abbrev=0 | sed 's/^v//')
|
||||||
|
IFS='.' read -r major minor patch <<< "$current_version"
|
||||||
|
|
||||||
|
if [ "$1" == "major" ]; then
|
||||||
|
major=$((major + 1)); minor=0; patch=0
|
||||||
|
new_version="${major}.${minor}.${patch}"
|
||||||
|
elif [ "$1" == "minor" ]; then
|
||||||
|
minor=$((minor + 1)); patch=0
|
||||||
|
new_version="${major}.${minor}.${patch}"
|
||||||
|
elif [ "$1" == "patch" ]; then
|
||||||
|
patch=$((patch + 1))
|
||||||
|
new_version="${major}.${minor}.${patch}"
|
||||||
|
elif [[ "$1" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
new_version="$1"
|
||||||
|
else
|
||||||
|
echo "Invalid argument: must be 'major', 'minor', 'patch', or a specific version (e.g. 1.2.3)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Tagging v$new_version"
|
||||||
|
git tag "v$new_version"
|
||||||
|
fi
|
||||||
|
git push
|
||||||
|
git push --tags
|
||||||
|
|
||||||
|
make build-production TAG="$new_version"
|
||||||
cd "$parent_path/ansible" || exit
|
cd "$parent_path/ansible" || exit
|
||||||
ansible-playbook --inventory=hosts playbook.yml
|
ansible-playbook --inventory=hosts playbook.yml
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "overlord",
|
"name": "overlord",
|
||||||
"version": "15.3.1",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry
|
ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry
|
||||||
version: '15.3.1',
|
|
||||||
title: 'HnG / TGB',
|
title: 'HnG / TGB',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -194,5 +194,5 @@
|
|||||||
</mat-tab>
|
</mat-tab>
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<p>Backend: v{{ auth.user?.ver }} / Frontend: v{{ version }}</p>
|
<p>v{{ auth.user?.ver }}</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import { MatTabsModule } from '@angular/material/tabs';
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { AccountTypeService } from '../account/account-type.service';
|
import { AccountTypeService } from '../account/account-type.service';
|
||||||
import { environment } from '../app.environment';
|
|
||||||
import { AuthService } from '../auth/auth.service';
|
import { AuthService } from '../auth/auth.service';
|
||||||
import { AccountType } from '../core/account-type';
|
import { AccountType } from '../core/account-type';
|
||||||
import { endOfMonth, formatDisplayDate, formatIsoDate } from '../core/date-utils';
|
import { endOfMonth, formatDisplayDate, formatIsoDate } from '../core/date-utils';
|
||||||
@@ -117,12 +116,6 @@ export class SettingsComponent {
|
|||||||
|
|
||||||
displayedColumns = ['index', 'validity', 'voucherTypes', 'accountTypes', 'lock', 'action'];
|
displayedColumns = ['index', 'validity', 'voucherTypes', 'accountTypes', 'lock', 'action'];
|
||||||
|
|
||||||
version: string;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
this.version = environment.version;
|
|
||||||
}
|
|
||||||
|
|
||||||
showLockInformation(info: LockInfo[]) {
|
showLockInformation(info: LockInfo[]) {
|
||||||
this.lockInformation.set(info);
|
this.lockInformation.set(info);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P )
|
|
||||||
cd "$parent_path" || exit
|
|
||||||
|
|
||||||
last_commit_subject=$(git log -1 --format=%s)
|
|
||||||
if [[ "$last_commit_subject" =~ ^Version\ Bump ]]; then
|
|
||||||
echo "Last commit is already a version bump (\"$last_commit_subject\"). Nothing to do."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ 1 -eq "$#" ]
|
|
||||||
then
|
|
||||||
current_version=$(grep -m 1 '^version = ' brewman/pyproject.toml | sed -E 's/version = "([^"]+)"/\1/')
|
|
||||||
IFS='.' read -r major minor patch <<< "$current_version"
|
|
||||||
|
|
||||||
if [ "$1" == "major" ]; then
|
|
||||||
major=$((major + 1))
|
|
||||||
minor=0
|
|
||||||
patch=0
|
|
||||||
new_version="${major}.${minor}.${patch}"
|
|
||||||
elif [ "$1" == "minor" ]; then
|
|
||||||
minor=$((minor + 1))
|
|
||||||
patch=0
|
|
||||||
new_version="${major}.${minor}.${patch}"
|
|
||||||
elif [ "$1" == "patch" ]; then
|
|
||||||
patch=$((patch + 1))
|
|
||||||
new_version="${major}.${minor}.${patch}"
|
|
||||||
elif [[ "$1" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
||||||
new_version="$1"
|
|
||||||
else
|
|
||||||
echo "Invalid argument: must be 'major', 'minor', 'patch', or a specific version (e.g. 1.2.3)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Version bump from $current_version to $new_version"
|
|
||||||
sed --in-place --regexp-extended 's/"([0-9]{1,2}.[0-9]+.[0-9]+)"/"'"$new_version"'"/g' brewman/brewman/__version__.py
|
|
||||||
git add brewman/brewman/__version__.py
|
|
||||||
sed --in-place --regexp-extended 's/version = "([0-9]{1,2}.[0-9]+.[0-9]+)"/version = "'"$new_version"'"/g' brewman/pyproject.toml
|
|
||||||
(cd brewman && uv lock)
|
|
||||||
git add brewman/pyproject.toml brewman/uv.lock
|
|
||||||
sed --in-place --regexp-extended 's/version: '\''([0-9]*.[0-9]+.[0-9]+)'\''/version: '\'"$new_version"\''/g' overlord/src/app/app.environment.ts
|
|
||||||
git add overlord/src/app/app.environment.ts
|
|
||||||
sed --in-place --regexp-extended 's/"version": "([0-9]{1,2}.[0-9]+.[0-9]+)"/"version": "'"$new_version"'"/g' overlord/package.json
|
|
||||||
git add overlord/package.json
|
|
||||||
git commit -m "Version Bump v$new_version"
|
|
||||||
git tag "v$new_version"
|
|
||||||
else
|
|
||||||
echo "No version bump"
|
|
||||||
echo "Usage: $0 <major|minor|patch|version_string>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
git push
|
|
||||||
git push --tags
|
|
||||||
Reference in New Issue
Block a user