-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
48 lines (33 loc) · 1.39 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
VERSION=$(shell git describe)
uname_s := $(shell uname -s)
uname_m := $(shell uname -m)
# system specific variables, add more here
# On linux systems, you can access docker directly if you're in the docker group.
DOCKER_GROUP := $(shell groups | tr ' ' '\n' | grep -w docker)
ifeq ($(DOCKER_GROUP),docker)
DOCKER.Linux.x86_64 := docker
else
DOCKER.Linux.x86_64 := sudo docker
endif
DOCKER.Darwin.x86_64 := docker
DOCKER += $(DOCKER.$(uname_s).$(uname_m))
format:
ormolu --mode inplace $(shell find lib server daemon test -name '*.hs')
build-server-image:
nix build
$(DOCKER) load < result
build-client-image:
$(DOCKER) build -t aftok/aftok-client:latest -f ./client/Dockerfile .
build-images: build-server-image build-client-image
deploy-local-server-image: build-server-image
$(DOCKER) tag aftok/aftok-server:latest aftok/aftok-server:$(VERSION)
deploy-local-client-image: build-client-image
$(DOCKER) tag aftok/aftok-client:latest aftok/aftok-client:$(VERSION)
deploy-server-image: deploy-local-server-image
$(DOCKER) push docker.io/aftok/aftok-server:latest
$(DOCKER) push docker.io/aftok/aftok-server:$(VERSION)
deploy-client-image: deploy-local-client-image
$(DOCKER) push docker.io/aftok/aftok-client:latest
$(DOCKER) push docker.io/aftok/aftok-client:$(VERSION)
deploy-images: deploy-server-image deploy-client-image
deploy-local-images: deploy-local-server-image deploy-local-client-image