-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (33 loc) · 999 Bytes
/
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
.PHONY: dev build run push release release-multi deploy
DOCKER_REPOSITERY=dixneuf19
IMAGE_NAME=fip-telegram-bot
IMAGE_TAG=$(shell git rev-parse HEAD)
DOCKER_IMAGE_PATH=$(DOCKER_REPOSITERY)/$(IMAGE_NAME):$(IMAGE_TAG)
APP_NAME=fip-telegram-bot
KUBE_NAMESPACE=fip
PLATFORMS="linux/amd64,linux/arm64"
dev:
PYTHONPATH=. python fip_telegram_bot/main.py
format:
black .
check-format:
black --check .
test:
PYTHONPATH=. pytest tests
build:
docker build -t $(DOCKER_IMAGE_PATH) .
build-multi:
docker buildx build --platform $(PLATFORMS) -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 $(PLATFORMS) -t $(DOCKER_IMAGE_PATH) . --push
deploy:
kubectl apply -f $(APP_NAME).yaml
secret:
kubectl create secret generic fip-telegram-bot --from-env-file=.env
kube-credentials:
NAMESPACE=${KUBE_NAMESPACE} ./scripts/generate-kubeconfig.sh