-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
70 lines (52 loc) · 2.09 KB
/
justfile
File metadata and controls
70 lines (52 loc) · 2.09 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
IMAGE_NAME := "skynet"
# Default target
default:
@just --list
# Docker targets
build tag="latest":
# Build Docker image (uses cache)
docker build --build-arg GIT_COMMIT=$(git rev-parse --short HEAD) -t {{IMAGE_NAME}}:{{tag}} .
build-fresh tag="latest":
# Build Docker image, force refresh source code but keep dependency cache
docker build --build-arg GIT_COMMIT=$(git rev-parse --short HEAD) \
--build-arg CACHEBUST=$(git rev-parse HEAD) \
-t {{IMAGE_NAME}}:{{tag}} .
run: test
# Build and Run Docker container
docker build --build-arg GIT_COMMIT=$(git rev-parse --short HEAD) -t {{IMAGE_NAME}}:local .
docker run --rm -p 8081:80 {{IMAGE_NAME}}:local
shell:
# Open a shell into the running container
docker-compose exec {{IMAGE_NAME}} sh
# Cleanup targets
clean-docker:
# Clean up Docker images and containers
docker system prune -f
docker volume prune -f
push-gitdocker tag="latest":
# Build with fresh code (keeps dependency cache) and push
docker build --build-arg GIT_COMMIT=$(git rev-parse --short HEAD) \
--build-arg CACHEBUST=$(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}}
push-gitdocker-full tag="latest":
# Full rebuild without any cache and push
docker build --no-cache --build-arg GIT_COMMIT=$(git rev-parse --short HEAD) -t {{IMAGE_NAME}}:{{tag}} .
docker tag {{IMAGE_NAME}} ghcr.io/montelibero/{{IMAGE_NAME}}:{{tag}}
docker push ghcr.io/montelibero/{{IMAGE_NAME}}:{{tag}}
lint:
uv run --group dev ruff check .
format:
uv run --group dev ruff format .
types:
uv run --group dev pyright
test:
uv run --group dev pytest
secrets:
# Scan for leaked secrets (requires gitleaks: https://github.com/gitleaks/gitleaks)
if command -v gitleaks >/dev/null 2>&1; then \
gitleaks detect --source . -v; \
else \
docker run --rm -v "$PWD:/src" zricethezav/gitleaks detect --source /src -v; \
fi