-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
86 lines (74 loc) · 1.5 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
SHELL := /bin/bash
# Read the directories from go.work file
GO_WORK_FILE := go.work
GO_DIRS := $(shell grep -oE '^\s*\./\S+' $(GO_WORK_FILE) | sed 's/^\s*\.//')
.PHONY: all
all: tidy vendor compose-build
.PHONY: tidy
tidy:
@for dir in $(GO_DIRS); do \
echo "Running 'go mod tidy' in $$dir"; \
(cd $$dir && go mod tidy); \
done
.PHONY: vendor
vendor:
@for dir in $(GO_DIRS); do \
echo "Running 'go mod vendor' in $$dir"; \
(cd $$dir && go mod vendor); \
done
.PHONY: prune
prune:
@for dir in $(GO_DIRS); do \
echo "Running 'rm -rf ./vendor' in $$dir"; \
(cd $$dir && rm -rf ./vendor); \
done
.PHONY: build
build:
@for dir in $(GO_DIRS); do \
echo "Running 'make build' in $$dir"; \
(cd $$dir && make build); \
done
.PHONY: run
run:
@for dir in $(GO_DIRS); do \
echo "Running 'make run' in $$dir"; \
(cd $$dir && make run); \
done
.PHONY: clean
clean:
@for dir in $(GO_DIRS); do \
echo "Running 'make clean' in $$dir"; \
(cd $$dir && make clean); \
done
.PHONY: compose-up
compose-up:
@docker compose \
--file ./compose.yaml \
up \
--detach \
--force-recreate \
--remove-orphans \
--timestamps
.PHONY: compose-build
compose-build:
@docker compose \
--file ./compose.yaml \
up \
--detach \
--build \
--force-recreate \
--remove-orphans \
--timestamps
.PHONY: compose-down
compose-down:
@docker compose \
--file ./compose.yaml \
down \
--remove-orphans
.PHONY: compose-delete
compose-delete:
@docker compose \
--file ./compose.yaml \
down \
--remove-orphans \
--volumes