37 lines
993 B
Makefile
37 lines
993 B
Makefile
.PHONY: format help
|
|
|
|
# Help system from https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
|
|
.DEFAULT_GOAL := help
|
|
|
|
help:
|
|
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
|
|
|
setup: ## Install Python dependencies
|
|
python3 -m venv .venv
|
|
.venv/bin/pip install -r requirements.txt
|
|
|
|
up: ## Run all the containers in the background
|
|
mkdir -p data/logs
|
|
docker-compose up -d --build
|
|
|
|
run: ## Run Python script to fetch blocks and update Elasticsearch
|
|
.venv/bin/python3 main.py
|
|
|
|
ps: ## Show currently running containers
|
|
docker-compose ps
|
|
|
|
logs: ## Begin streaming logs to terminal
|
|
docker-compose logs -f
|
|
|
|
stop: ## Stop all containers
|
|
docker-compose stop
|
|
|
|
start: ## Start all containers
|
|
docker-compose start
|
|
|
|
down: ## Stop and remove all containers
|
|
docker-compose down --remove-orphans
|
|
|
|
clean: ## Stop and remove all containers and their data
|
|
rm -rf ./data/elasticsearch ./data/logstash/
|