-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (42 loc) · 1.2 KB
/
Copy pathMakefile
File metadata and controls
57 lines (42 loc) · 1.2 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
# NetOps Assistant Makefile
.PHONY: help build up down restart logs clean test
# Variables
COMPOSE = docker-compose
COMPOSE_PROD = docker-compose -f docker-compose.prod.yml
PROJECT = netops-assistant
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
build: ## Build Docker images
$(COMPOSE) build
up: ## Start all services
$(COMPOSE) up -d
@echo "Services started:"
@echo "Grafana: http://localhost:3000"
@echo "Prometheus: http://localhost:9091"
@echo "Metrics: http://localhost:9090/metrics"
down: ## Stop all services
$(COMPOSE) down
restart: down up ## Restart all services
logs: ## Show logs
$(COMPOSE) logs -f
clean: ## Clean up everything
$(COMPOSE) down -v
docker system prune -f
test: ## Run tests
$(COMPOSE) run --rm bot pytest tests/
prod-up: ## Start production
$(COMPOSE_PROD) up -d
prod-down: ## Stop production
$(COMPOSE_PROD) down
backup: ## Backup data
./docker-control.sh backup
update: ## Update and restart
git pull
$(COMPOSE) pull
$(COMPOSE) build
$(MAKE) restart
install: ## Initial setup
cp .env.example .env
@echo "Please edit .env file"
$(MAKE) build
$(MAKE) up