-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (31 loc) · 1.14 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
variables ?= .env
args = $(filter-out $@,$(MAKECMDGOALS))
DOCKER_DEV=drawing-app:dev
DOCKER_PROD=drawing-app:prod
include $(variables)
export $(shell sed 's/=.*//' $(variables))
# Apollo
create-generated-gql-folder:
mkdir -p $(REACT_APP_GQL_GENERATED_OUTPUT_PATH)
introspect-schema:
apollo-codegen introspect-schema $(REACT_APP_GQL_ENDPOINT) --output $(REACT_APP_GQL_GENERATED_SCHEMA_PATH)
generate-types-from-schema:
apollo-codegen generate ./src/**/graphql/**/*.ts --schema $(REACT_APP_GQL_GENERATED_SCHEMA_PATH) --target typescript --output $(REACT_APP_GQL_GENERATED_TYPES_PATH) --addTypename
generate-types: create-generated-gql-folder introspect-schema generate-types-from-schema
# Docker
build-dev:
docker build -t $(DOCKER_DEV) .
build-prod:
docker build -f Dockerfile.prod -t $(DOCKER_PROD) .
dev:
docker-compose up -d --build
dev--ro:
docker-compose up -d --build --remove-orphans
prod:
docker-compose -f docker-compose.prod.yml up -d --build
prod--ro:
docker-compose -f docker-compose.prod.yml up -d --build --remove-orphans
start: prod--ro
stop:
docker-compose -f docker-compose.yml -f docker-compose.prod.yml stop
restart: stop start