-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
73 lines (52 loc) · 3.07 KB
/
Copy pathjustfile
File metadata and controls
73 lines (52 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
IMAGE_NAME := "support_bot"
# Default target
default:
@just --list
# Quality targets (AI-first bootstrap)
test *args="":
uv run --group dev pytest {{args}}
test-fast:
uv run --group dev pytest -q tests/test_customization.py tests/test_webhook_updates.py
lint:
uv run --group dev ruff check bot/customizations main.py tests/test_customization.py tests/test_webhook_updates.py tests/test_startup_error.py
fmt:
uv run --group dev ruff format bot/customizations main.py tests/test_customization.py tests/test_webhook_updates.py tests/test_startup_error.py
types:
uv run --group dev pyright bot/customizations main.py tests/test_customization.py tests/test_webhook_updates.py tests/test_startup_error.py
arch-test:
@uv run python -c "import pathlib,sys; req=['AGENTS.md','docs/architecture.md','docs/conventions.md','docs/golden-principles.md','docs/glossary.md','docs/exec-plans/active/_template.md','adr/README.md','.linters/README.md']; miss=[p for p in req if not pathlib.Path(p).exists()]; print('arch-test: OK' if not miss else 'arch-test: missing -> ' + ', '.join(miss)); sys.exit(0 if not miss else 1)"
check:
uv run --group dev ruff format --check bot/customizations main.py tests/test_customization.py tests/test_webhook_updates.py tests/test_startup_error.py && just lint && just types && just test-fast
check-changed:
uv run --group dev python -c "import subprocess,sys; rows=subprocess.check_output(['git','status','--porcelain']).decode().splitlines(); paths=sorted({r[3:].strip() for r in rows if len(r)>3 and r[3:].strip().endswith('.py') and ' -> ' not in r}); print('changed python files:', paths if paths else '<none>'); sys.exit(0) if not paths else None; subprocess.check_call(['uv','run','--group','dev','ruff','format','--check',*paths]); subprocess.check_call(['uv','run','--group','dev','ruff','check',*paths]); subprocess.check_call(['uv','run','--group','dev','pyright',*paths])"
# Docker targets
build tag="latest":
# Build Docker image
docker build --build-arg GIT_COMMIT=$(git rev-parse HEAD) -t {{IMAGE_NAME}}:{{tag}} .
run:
# Build and Run Docker container
docker build --build-arg GIT_COMMIT=$(git rev-parse HEAD) -t {{IMAGE_NAME}}:local .
# echo "http://127.0.0.1:8081"
# docker run --rm -p 8081:80 {{IMAGE_NAME}}:local
stop:
# Stop Docker container
docker-compose down
rebuild:
# Rebuild and restart the docker container
docker-compose build --no-cache && docker-compose up -d --force-recreate
logs:
# View container logs
docker-compose logs -f
shell:
# Open a shell into the running container
docker-compose exec viewer-caddy sh
# Cleanup targets
clean:
# Find and remove all __pycache__ directories
find . -type d -name "__pycache__" -exec rm -rf {} +
# Find and remove all .log files
find . -type f -name "*.log" -exec rm -f {} +
#push-gitdocker tag="latest":
# docker build --build-arg GIT_COMMIT=$(git rev-parse HEAD) -t {{IMAGE_NAME}}:{{tag}} .
# docker tag {{IMAGE_NAME}} ghcr.io/montelibero/{{IMAGE_NAME}}:{{tag}}
# docker push ghcr.io/montelibero/{{IMAGE_NAME}}:{{tag}}