-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (58 loc) · 1.98 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
64
65
66
67
68
69
70
71
include .env
##################
# Setting
##################
check-deps:
# used to test API
clj --version
# used to run docker container
docker --version
# used to run docker container
node -v
init:
echo 'DATABASE_URL="mysql://learn-lacinia:[email protected]:11002/sakila"' > ./backend/apollo/.env
echo 'NEXT_PUBLIC_API_ENDPOINT="http://localhost:11004"' > ./frontend/.env
##################
# Development
##################
serve-db:
docker compose up db
serve-apollo:
yarn --cwd backend/apollo start
##################
# NOTICE: The command below this is a development-only command and is not intended for general use.
##################
##################
# Test
##################
api-test:
bb ./backend/tests/main.clj
###################
## Deployment
###################
commit-all:
docker commit sakila-nginx ${IMAGE_REPO_ENDPOINT}/${IMAGE_REPO_PREFIX}/${IMAGE_REPO_NGINX}:${IMAGE_TAG}
docker commit sakila-clj-api ${IMAGE_REPO_ENDPOINT}/${IMAGE_REPO_PREFIX}/${IMAGE_REPO_CLJ_API}:${IMAGE_TAG}
docker commit sakila-db ${IMAGE_REPO_ENDPOINT}/${IMAGE_REPO_PREFIX}/${IMAGE_REPO_DB}:${IMAGE_TAG}
push-all:
docker push ${IMAGE_REPO_ENDPOINT}/${IMAGE_REPO_PREFIX}/${IMAGE_REPO_NGINX}:${IMAGE_TAG}
docker push ${IMAGE_REPO_ENDPOINT}/${IMAGE_REPO_PREFIX}/${IMAGE_REPO_CLJ_API}:${IMAGE_TAG}
docker push ${IMAGE_REPO_ENDPOINT}/${IMAGE_REPO_PREFIX}/${IMAGE_REPO_DB}:${IMAGE_TAG}
###################
## Document
###################
serve-gql-doc:
spectaql ./docs/graphql/config.yml -t docs/graphql -D
serve-rest-doc:
python -m http.server 8000 -d docs/rest
REPO_URL = https://github.com/wf001/learn-lacinia
show-compare-tags:
@tags=$$(git tag); \
num_tags=$$(echo "$$tags" | wc -l); \
for i in $$(seq 2 $$num_tags); do \
tag_old=$$(echo "$$tags" | sed -n $$((i-1))p); \
tag_new=$$(echo "$$tags" | sed -n $$i"p"); \
echo "- [$$tag_new](https://github.com/wf001/learn-lacinia/tree/$$tag_new)"; \
echo " - message"; \
echo " - [diff]($(REPO_URL)/compare/$$tag_old...$$tag_new)"; \
done