-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (44 loc) · 969 Bytes
/
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
#!/usr/bin/make -ef
NAME = go-space
VERSION=0.0.8
MODULE_NAME = github.com/bahner/go-space
GO ?= go
PREFIX ?= /usr/local
ifneq (,$(wildcard ./.env))
include .env
export
endif
default: clean tidy $(NAME)
init: go.mod tidy
go.mod:
$(GO) mod init $(MODULE_NAME)
tidy: go.mod
$(GO) mod tidy
$(NAME): tidy
$(GO) build -o $(NAME)
clean:
rm -f $(NAME)
console:
docker-compose up -d
docker attach go-space-pubsub_space_1
distclean: clean
rm -f $(shell git ls-files --exclude-standard --others)
down:
docker-compose down
image:
docker build \
-t $(IMAGE) \
--build-arg "BUILD_IMAGE=$(BUILD_IMAGE)" \
.
install:
install -Dm755 $(NAME) $(DESTDIR)$(PREFIX)/bin/$(NAME)
run: clean $(NAME)
./$(NAME)
release: default
git tag -a $(VERSION) -m "Release $(VERSION)"
git push origin $(VERSION)
up:
docker-compose up -d --remove-orphans
vault:
docker-compose up -d vault
.PHONY: default init tidy build client serve install clean distclean