-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (38 loc) · 898 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
GOCMD=go
GOBUILD=$(GOCMD) build
GOTEST=$(GOCMD) test
GOCLEAN=$(GOCMD) clean
BINARY_NAME=cnapi
BUILD_DIR=build
# Main build target
build:
$(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) -v
# Run tests
test:
$(GOTEST) -v ./...
# Clean up
clean:
$(GOCLEAN)
rm -f $(BUILD_DIR)/$(BINARY_NAME)
# Build and run the application
run: build
./$(BUILD_DIR)/$(BINARY_NAME)
# Docker specific
dkdev:
docker-compose -f compose.dev.yml up -d
dkdevstop:
docker-compose -f compose.dev.yml stop
dkdevrm:
docker-compose -f compose.dev.yml rm --stop --force
dkdevwatch:
docker-compose -f compose.dev.yml watch
dkdevbuild:
docker-compose -f compose.dev.yml up --build -d
dkprod:
docker-compose -f compose.prod.yml up -d
dkprodbuild:
docker-compose -f compose.prod.yml up --build -d
dkprodstop:
docker-compose -f compose.prod.yml stop
dkprodrm:
docker-compose -f compose.prod.yml rm --stop --force