-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (31 loc) · 828 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
# List of command names (directories)
COMMANDS := web cli
# Build all commands
build: $(COMMANDS)
# Test all directories
test:
@echo "Testing..."
@go test ./...
# Build a specific command
$(COMMANDS):
@echo "Building $@..."
@go build -o bin/pm-$@ ./cmd/$@/main.go
# Clean all built commands
clean:
@echo "Cleaning..."
@rm -rf bin/*
# Run a specific command
run-%: build
@echo "Running $*..."
@./bin/$*
# Build the Docker container
build-docker:
@echo "Building container..."
$(eval GIT_TAG := $(shell git rev-parse --short HEAD))
@echo ----------------------------------------
@echo Git tag is: $(GIT_TAG), tagging container version
@echo ----------------------------------------
@docker build -t plex-monitor:latest .
@docker build -t plex-monitor:$(GIT_TAG) .
# Default target
.DEFAULT_GOAL := build