-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (48 loc) · 1.45 KB
/
Makefile
File metadata and controls
62 lines (48 loc) · 1.45 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
BUILD_DATE_TAG=$(shell date "+d%y.%m.%d-t%H.%M")
IMAGE_PUBLISH_PATH?=docker.io/davidvader/go-ebiten-multiplayer
DOCKERFILE_PATH?=Dockerfile
clt:
@echo "running client"
go run cmd/client/main.go
clt-local:
@echo "running client in local mode"
CLIENT_MULTIPLAYER=false \
go run cmd/client/main.go
srv:
@echo "running server"
go run cmd/server/main.go
kill-srv:
@echo "Killing any frozen wasm processes related to specified ports"
for port in 8080 8090 8091; do \
for process in nc wasmserve curl main; do \
lsof -P | grep $$port | grep $$process | awk '{print $$2}' | xargs -r kill -9; \
done; \
done
up: build run
restart: down up
publish: build-static tag push
run:
@echo "running container"
docker run -d \
-p '8080:8080' \
-e SERVER_WS_HOST=localhost:8091 \
-e CLIENT_WS_HOST=localhost:8080 \
--name=game game:local
down:
@echo "tearing down"
-docker kill game
-docker rm game
build:
@echo "building image"
docker-buildx build -t game:local -f ${DOCKERFILE_PATH} .
build-static:
@echo "building static image for linux/amd64"
docker-buildx build -t game:local -f ${DOCKERFILE_PATH} --platform=linux/amd64 .
tag:
@echo "pushing image to ${IMAGE_PUBLISH_PATH}:${BUILD_DATE_TAG}"
docker tag game:local ${IMAGE_PUBLISH_PATH}:${BUILD_DATE_TAG}
push:
@echo "pushing image to ${IMAGE_PUBLISH_PATH}:${BUILD_DATE_TAG}"
docker push ${IMAGE_PUBLISH_PATH}:${BUILD_DATE_TAG}
# var/command overrides
-include Makefile.internal