-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathMakefile
88 lines (69 loc) · 1.8 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
MAKEFLAGS += --always-make
.SILENT: # don't output commands being executed
SHELL := /bin/bash
.ONESHELL:
export docker_registry ?= ghcr.io/joshzcold
export DOCKER_BUILDKIT=1
export game_store ?= memory
build-frontend:
set -x
docker build -t ${docker_registry}/famf-web:latest .
build-frontend-dev:
set -x
docker build -t ${docker_registry}/famf-web:dev --target dev .
build-allinone:
set -x
docker build -t ${docker_registry}/famf-allinone:latest \
-f Dockerfile.allinone .
build-backend:
set -x
cd backend
docker build \
--build-context=games=../games \
-t ${docker_registry}/famf-server:latest .
build-backend-dev:
set -x
cd backend
docker build \
--build-context=games=../games \
-t ${docker_registry}/famf-server:dev --target dev .
build: build-frontend build-backend build-allinone
push: build
docker push ${docker_registry}/famf-web:latest
docker push ${docker_registry}/famf-server:latest
docker push ${docker_registry}/famf-allinone:latest
build-dev: build-frontend-dev build-backend-dev
# Use different yaml for WSL
ifneq ($(shell uname -r | grep -i microsoft),)
COMPOSE_FILE=docker-compose-dev-wsl.yaml
else
COMPOSE_FILE=docker-compose-dev.yaml
endif
dev: build-dev
docker compose -p famf -f ./docker/${COMPOSE_FILE} up
dev-background: build-dev
docker compose -p famf -f ./docker/${COMPOSE_FILE} up -d --wait --wait-timeout 120
dev-down:
docker compose -p famf -f ./docker/${COMPOSE_FILE} down
e2e: dev-background
npm install
cd e2e
npm install
npx playwright test
cd -
$(MAKE) dev-down
e2e-ui: dev-background
npm install
cd e2e
npm install
npx playwright test --ui
cd -
$(MAKE) dev-down
e2e-prod:
cd e2e
npm install
npx playwright test --ui --config playwright-prod.config.js
e2e-dev:
cd e2e
npm install
npx playwright test --ui --config playwright-dev.config.js