-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
58 lines (43 loc) · 1.49 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
# Bump these on release, and for now manually update the deployment files:
# docker-compose.yml, stack.yml and package.json
VERSION_MAJOR ?= 0
VERSION_MINOR ?= 4
BUILD_NUMBER ?= 2
PATCH_STRING ?=
VERSION_STRING = $(VERSION_MAJOR).$(VERSION_MINOR).$(BUILD_NUMBER)$(PATCH_STRING)
IMAGE_TAG ?= $(VERSION_MAJOR).$(VERSION_MINOR).$(BUILD_NUMBER)
REGISTRY_USER ?= rajchaudhuri
.PHONY: usage
usage:
@echo "Usage:"
@echo "make server|client|client-debug|debug|all|clean|image|run-image|clean-image"
.PHONY: all
all: client server
.PHONY: public
public:
npm run build-public
out/js/client.js: client/*.js
npm run build-client-release
.PHONY: client
client: public out/js/client.js
.PHONY: client-debug
client-debug: public client/*.js
npm run build-client-debug
out/voxel-dockerserver: server/*.go
CGO_ENABLED='0' go build -o out/voxel-dockerserver -ldflags "-X 'main.version=$(VERSION_STRING)'" server/*.go
.PHONY: server
server: out/voxel-dockerserver
.PHONY: debug
debug: public client-debug server
.PHONY: clean
clean:
rm -rf out/*
.PHONY: image
image:
docker image build -t $(REGISTRY_USER)/voxel-dockerclient:$(VERSION_STRING) -f Dockerfile --build-arg VERSION_STRING=$(VERSION_STRING) .
.PHONY: run-image
run-image: image
docker container run --rm --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock --publish 8080:8080 $(REGISTRY_USER)/voxel-dockerclient:$(VERSION_STRING)
.PHONY: clean-image
clean-image:
docker image rm $(REGISTRY_USER)/voxel-dockerclient:$(VERSION_STRING)