-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathmakefile
More file actions
90 lines (77 loc) · 2.63 KB
/
makefile
File metadata and controls
90 lines (77 loc) · 2.63 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
ifneq (,$(wildcard .env))
include .env
export
endif
PLATFORM ?= linux/amd64
ARCH ?= amd64
VERSION ?= dev
COMMIT_HASH ?= $(shell git rev-parse HEAD)
BUILD_TIME ?= $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
IMG_TAG ?= $(shell grep -A 5 "^ api:" docker-compose.yml | grep "image:" | sed 's/.*://' | xargs)
image.api:
cd backend && DOCKER_BUILDKIT=1 docker build \
--build-arg VERSION=${VERSION} \
--build-arg COMMIT_HASH=${COMMIT_HASH} \
--build-arg BUILD_TIME=${BUILD_TIME} \
--build-arg HTTP_PROXY=${HTTP_PROXY} \
--build-arg HTTPS_PROXY=${HTTPS_PROXY} \
-t chaitin-registry.cn-hangzhou.cr.aliyuncs.com/koalaqa/api:${IMG_TAG} .
image.app:
cd ui && DOCKER_BUILDKIT=1 docker build \
--build-arg HTTP_PROXY=${HTTP_PROXY} \
--build-arg HTTPS_PROXY=${HTTPS_PROXY} \
-t chaitin-registry.cn-hangzhou.cr.aliyuncs.com/koalaqa/app:${IMG_TAG} .
image.db:
cd docker/db && DOCKER_BUILDKIT=1 docker build \
-t chaitin-registry.cn-hangzhou.cr.aliyuncs.com/koalaqa/db:17.6-bookworm .
image.raglite:
cd docker/raglite && DOCKER_BUILDKIT=1 docker build \
-t chaitin-registry.cn-hangzhou.cr.aliyuncs.com/koalaqa/raglite:v2.16.1 .
image.nginx:
cd docker/nginx && DOCKER_BUILDKIT=1 docker build \
-t chaitin-registry.cn-hangzhou.cr.aliyuncs.com/koalaqa/nginx:1.28.0 .
image.anydoc:
cd docker/anydoc && DOCKER_BUILDKIT=1 docker build \
-t chaitin-registry.cn-hangzhou.cr.aliyuncs.com/koalaqa/anydoc:v0.9.11 .
image.mq:
cd docker/mq && DOCKER_BUILDKIT=1 docker build \
-t chaitin-registry.cn-hangzhou.cr.aliyuncs.com/koalaqa/mq:2.11.8-alpine3.22 .
run: image.app image.api
docker compose up -d
run.app: image.app
docker compose up -d
run.api: image.api
docker compose up -d
swagger:
cd backend && make swagger
tag:
@VERSION=$(filter-out $@,$(MAKECMDGOALS)); \
if [ -z "$$VERSION" ]; then \
echo "Error: Please specify version tag, e.g.: make tag v1.0.0"; \
exit 1; \
fi; \
if git tag -l | grep -q "^$$VERSION$$"; then \
echo "Warning: Tag '$$VERSION' already exists"; \
echo -n "Do you want to force overwrite this tag? (y/N): "; \
read -r answer; \
case $$answer in \
[Yy]* ) \
echo "Deleting existing tag..."; \
git tag -d $$VERSION 2>/dev/null || true; \
git push origin :refs/tags/$$VERSION 2>/dev/null || true; \
echo "Creating new tag..."; \
git tag $$VERSION && git push origin $$VERSION; \
echo "Tag '$$VERSION' has been successfully overwritten"; \
;; \
* ) \
echo "Operation cancelled"; \
exit 1; \
;; \
esac; \
else \
echo "Creating tag '$$VERSION'..."; \
git tag $$VERSION && git push origin $$VERSION; \
echo "Tag '$$VERSION' has been successfully created"; \
fi
%:
@: