-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (27 loc) · 1.2 KB
/
Copy pathMakefile
File metadata and controls
39 lines (27 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
# Convenience targets for the local Elasticsearch dev setup.
# Run `make help` to list available commands.
.DEFAULT_GOAL := help
.PHONY: help setup up down restart logs health status ps clean
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-10s\033[0m %s\n", $$1, $$2}'
setup: ## One-time host prep (sets vm.max_map_count)
./scripts/setup-host.sh
up: ## Start Elasticsearch in the background
docker compose up -d
down: ## Stop and remove the container (data volume kept)
docker compose down
restart: ## Restart the container
docker compose restart
logs: ## Follow Elasticsearch logs
docker compose logs -f elasticsearch
ps: ## Show container status
docker compose ps
health: ## Print cluster health (status should be green/yellow)
@curl -s http://localhost:9200/_cluster/health?pretty
status: ## Print cluster info (version, name)
@curl -s http://localhost:9200?pretty
clean: ## Stop AND delete the data volume (DESTRUCTIVE)
@printf "⚠️ This DELETES all Elasticsearch data (the esdata volume). Continue? [y/N] "
@read ans; [ "$$ans" = "y" ] || [ "$$ans" = "Y" ] || { echo "Aborted."; exit 1; }
docker compose down -v