-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (67 loc) · 2.22 KB
/
Makefile
File metadata and controls
79 lines (67 loc) · 2.22 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
# Colors for displaying text in the terminal
RED := $(shell tput -Txterm setaf 1)
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
BOLD := $(shell tput -Txterm bold)
RESET := $(shell tput -Txterm sgr0)
TARGET_MAX_CHAR_NUM=30
## Show help
help:
@echo ''
@echo 'Usage:'
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
@echo ''
@echo 'Targets:'
@awk '/^[a-zA-Z\-_0-9]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${YELLOW}%-$(TARGET_MAX_CHAR_NUM)s${RESET} ${GREEN}%s${RESET}\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
.PHONY: help
## Deploy production (will migrate database)
deploy:
kamal deploy
.PHONY: deploy
## Sync local images to s3 bucket
sync-images:
cd frontend/public && aws s3 sync . s3://arkham-horror-assets --acl public-read --exclude ".DS_Store"
.PHONY: sync-images
## Fetch all images via CloudFront (requires aws + curl)
fetch-images:
./scripts/fetch-assets.sh all
.PHONY: fetch-images
## Fetch only English card images via CloudFront (requires aws + curl)
fetch-cards:
./scripts/fetch-assets.sh cards
.PHONY: fetch-cards
## Fetch English images via Docker (no local aws CLI required)
fetch-images-docker:
docker compose --profile fetch-images run --rm fetch-images
.PHONY: fetch-images-docker
## Fetch only English card images via Docker
fetch-cards-docker:
docker compose --profile fetch-images run --rm fetch-images cards
.PHONY: fetch-cards-docker
## Regenerate image manifest (run after adding new images, before committing)
generate-manifest:
node scripts/generate-manifest.cjs
.PHONY: generate-manifest
## Sync images to S3 and regenerate manifest
sync-and-manifest:
./scripts/sync-and-manifest.sh
.PHONY: sync-and-manifest
## Install git hooks
install-hooks:
cp scripts/check-manifest.sh .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
@echo "Pre-commit hook installed."
.PHONY: install-hooks
## Count lines of code
count:
cloc . --include-lang=Haskell,TypeScript,Vue --exclude-dir=node_modules,dist,.stack-work --timeout=0
.PHONY: count