This repository has been archived by the owner on Sep 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
119 lines (88 loc) · 3.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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
export WWWGROUP=${WWWGROUP:-$(id -g)}
export WWWUSER=${WWWUSER:-$UID}
BACKEND_ENV=docker run --rm -i --user $(shell id -u):$(shell id -g) -v $(shell pwd)/packages/backend:/var/www/html -w /var/www/html laravelsail/php82-composer:latest
SAIL=$(shell pwd)/packages/backend/vendor/bin/sail
COMPOSER=docker run --rm -i --user `id -u`:`id -g` -v `pwd`:/app composer:2.3.10
setup-local:
(cd utils && cp .env_example .env)
@make erd-generate
@make backend-setup
@make frontend-setup
setup-ci:
@make frontend-setup
@make backend-setup
swagger-ui:
(cd utils && docker compose up swagger_ui -d --no-recreate )
open http://localhost:8080/
erd-generate:
(cd utils && docker compose run --rm utils yarn prisma:generate)
frontend-setup:
(cd packages/frontend && yarn install)
frontend-up-dev:
(cd packages/frontend && NODE_ENV=development && yarn dev)
frontend-build:
(cd packages/frontend && yarn build)
frontend-build-cloudflare:
(cd packages/frontend && corepack enable yarn && yarn install && yarn build)
backend-setup:
(cd packages/backend && cp .env.example .env)
(cd packages/backend && \
${BACKEND_ENV} composer install --ignore-platform-reqs)
(cd packages/backend && \
${BACKEND_ENV} php artisan key:generate)
@make backend-up
@make backend-generate
(cd packages/backend && ${SAIL} pint)
backend-build:
(cd packages/backend && \
${BACKEND_ENV} composer install --ignore-platform-reqs)
(cd packages/backend && ${SAIL} build ${BUILD_OPTIONS})
backend-generate:
(cd packages/backend && \
${BACKEND_ENV} php artisan ide-helper:generate)
@make backend-migrate
@make backend-annotation
@make backend-oas-generate
backend-up:
(cd packages/backend && ${SAIL} up -d --build && \
sleep 10)
backend-down:
(cd packages/backend && ${SAIL} down)
backend-destroy:
(cd packages/backend && ${SAIL} down -v)
backend-test:
(cd packages/backend && ${SAIL} test --coverage --coverage-clover clover.xml )
backend-lint:
(cd packages/backend && ${SAIL} pint)
@make backend-phpstan
backend-oas-generate:
(cd packages/backend && ${SAIL} artisan openapi:generate > $(shell pwd)/documents/api/schema.json)
backend-route-check:
(cd packages/backend && ${SAIL} artisan route:list)
all-containers-build:
@make backend-build
# (cd utils && docker compose build)
trivy:
trivy image $(shell docker images --format "{{.Repository}}:{{.Tag}}" | grep -v "<none>:<none>")
tinker:
(cd packages/backend && ${SAIL} tinker)
backend-bash:
(cd packages/backend && ${SAIL} bash)
backend-migrate:
(cd packages/backend && ${SAIL} artisan migrate)
backend-annotation:
(cd packages/backend && ${SAIL} artisan ide-helper:model --write)
backend-phpstan:
(cd packages/backend && ${BACKEND_ENV} vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=2G)
backend-infra-deploy:
(cd packages/infra/ec2 && cp setup_base.sh setup.sh && cat .credentials/cf_tunnel.sh >> setup.sh && terraform apply)
backend-infra-plan:
(cd packages/infra/ec2 && cp setup_base.sh setup.sh && cat .credentials/cf_tunnel.sh >> setup.sh && terraform plan)
backend-infra-plan-ci:
(cd packages/infra/ec2 && cp setup_base.sh setup.sh && terraform plan -no-color -input=false)
backend-infra-destroy:
(cd packages/infra/ec2 && terraform destroy)
backend-composer-update:
(cd packages/backend && ${COMPOSER} update)
slide-build:
(cd packages/intern-slide && yarn install && yarn build)