-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (56 loc) · 2.06 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
# Para executar os comandos abaixo, basta digitar no terminal:
# make <command>
# Exemplo: make compose_up_dev
# ─────────────────────────────────────────────────────
# Scripts para o ambiente Docker de desenvolvimento
compose_up_dev:
docker-compose -f docker-compose.dev.yml up -d
compose_down_dev:
docker-compose -f docker-compose.dev.yml down --remove-orphans
compose_rm_images_dev:
docker image rm dev_api_multiverse_travels_booker
# ─────────────────────────────────────────────────────
# Scripts para o ambiente Docker de produção
compose_up_prod:
docker-compose up -d
compose_down_prod:
docker-compose down --remove-orphans
compose_rm_images_prod:
docker image rm api_multiverse_travels_booker mysql_init_db
# ─────────────────────────────────────────────────────
# === Sam shortcut
# next lines are autogenerated and any changes will be discarded after regenerating
CRYSTAL_BIN ?= `which crystal`
SAM_PATH ?= sam.cr
.PHONY: sam
sam:
$(CRYSTAL_BIN) run $(SAM_PATH) -- $(filter-out $@,$(MAKECMDGOALS))
%:
@:
# === Sam shortcut
# Scripts mais usados do `jennifer ORM`:
# sam db:setup
# sam db:create
# sam db:migrate
# sam db:seed
# sam db:drop
# ─────────────────────────────────────────────────────
# Outros scripts
install_dependencies_dev:
shards install && make install_sentry
install_dependencies_prod:
shards install --production && make build
start_dev:
./sentry
build:
crystal build --static --release src/api.cr -o bin/api
start:
./bin/api
format:
crystal tool format
test:
crystal spec
install_sentry:
crystal build --release lib/sentry/src/sentry_cli.cr -o ./sentry
generate_docs:
crystal docs --output public src/api.cr