-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (45 loc) · 1.3 KB
/
Makefile
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
.PHONY: shell install install-dev dev build run push release release-multi deploy
PACKAGE_NAME=whats_on_fip
DOCKER_REPOSITERY=dixneuf19
IMAGE_NAME=whats-on-fip
IMAGE_TAG=$(shell git rev-parse --short HEAD)
DOCKER_IMAGE_PATH=$(DOCKER_REPOSITERY)/$(IMAGE_NAME):$(IMAGE_TAG)
APP_NAME=whats-on-fip
KUBE_NAMESPACE=fip
# Default target
all: dev
install:
rye sync --no-dev
install-dev:
rye sync
install-ci:
rye sync --no-lock
dev:
rye run uvicorn ${PACKAGE_NAME}.main:app --reload
format:
rye run isort .
rye run black .
check-format:
rye run isort --check .
rye run black --check .
rye run ruff .
rye run pyright
test:
rye run pytest --cov=${PACKAGE_NAME} --cov-report=xml tests
build:
docker build -t $(DOCKER_IMAGE_PATH) .
build-multi:
docker buildx build --platform linux/amd64,linux/arm64,linux/386,linux/arm/v7 -t $(DOCKER_IMAGE_PATH) .
run: build
docker run -p 8000:80 --env-file=.env $(DOCKER_IMAGE_PATH)
push:
docker push $(DOCKER_IMAGE_PATH)
release: build push
release-multi:
docker buildx build --platform linux/amd64,linux/arm64,linux/386,linux/arm/v7 -t $(DOCKER_IMAGE_PATH) . --push
deploy:
kubectl apply -f $(APP_NAME).yaml
secret:
kubectl create secret generic radio-france-api-token --from-env-file=.env
kube-credentials:
NAMESPACE=${KUBE_NAMESPACE} ./scripts/generate-kubeconfig.sh