-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (57 loc) · 1.51 KB
/
Copy pathMakefile
File metadata and controls
68 lines (57 loc) · 1.51 KB
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
# Git Version (Tag or Commit-Hash)
GIT_VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
APP_VERSION ?= $(GIT_VERSION)
export APP_VERSION
# Variables
DOCKER_COMPOSE = docker compose -f docker-compose.yml
# Help (default target)
.PHONY: help
help:
@echo "ScanSync - Makefile Commands"
@echo "================================"
@echo ""
@echo " Current version: $(GIT_VERSION)"
@echo ""
@echo "🚀 Production:"
@echo " start - Build and start all services"
@echo " stop - Stop all services"
@echo " restart - Restart all services"
@echo " logs - Show live logs"
@echo " build - Build all images"
@echo ""
@echo "🔧 General:"
@echo " status - Show the status of all containers"
@echo " clean - Stop all containers and remove unused images"
@echo " clean-all - Full cleanup (containers, images, volumes)"
@echo " test - Run the tests"
@echo ""
# Production
.PHONY: start
start:
@echo "Starting ScanSync (Version: $(GIT_VERSION))..."
$(DOCKER_COMPOSE) up --build -d
.PHONY: stop
stop:
$(DOCKER_COMPOSE) down
.PHONY: restart
restart: stop start
.PHONY: logs
logs:
$(DOCKER_COMPOSE) logs -f
.PHONY: build
build:
@echo "Building ScanSync (Version: $(GIT_VERSION))..."
$(DOCKER_COMPOSE) build
# General
.PHONY: status
status:
$(DOCKER_COMPOSE) ps
.PHONY: clean
clean:
$(DOCKER_COMPOSE) down --rmi local
.PHONY: clean-all
clean-all:
$(DOCKER_COMPOSE) down --rmi all -v
.PHONY: test
test:
./run-tests.sh