Skip to content

Commit

Permalink
✨ add makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanbekker committed Sep 18, 2024
1 parent bd5635c commit c7e8e39
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
27 changes: 27 additions & 0 deletions bitcoin/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Thanks: https://gist.github.com/mpneuried/0594963ad38e68917ef189b4e6a269db
.PHONY: help

help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

.DEFAULT_GOAL := help

# Determine whether to use "docker-compose" or "docker compose"
DOCKER_COMPOSE := $(shell which docker-compose 2>/dev/null)
ifeq ($(DOCKER_COMPOSE),)
DOCKER_COMPOSE := $(shell which docker 2>/dev/null)
PREFIX := compose
else
PREFIX :=
endif

# DOCKER TASKS
up: ## Runs the containers in detached mode with default config
$(DOCKER_COMPOSE) $(PREFIX) up -d --build

clean: ## Stops and removes all containers
$(DOCKER_COMPOSE) $(PREFIX) down

logs: ## View the logs from the containers
$(DOCKER_COMPOSE) $(PREFIX) logs -f

27 changes: 27 additions & 0 deletions geth-prysm/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Thanks: https://gist.github.com/mpneuried/0594963ad38e68917ef189b4e6a269db
.PHONY: help

help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

.DEFAULT_GOAL := help

# Determine whether to use "docker-compose" or "docker compose"
DOCKER_COMPOSE := $(shell which docker-compose 2>/dev/null)
ifeq ($(DOCKER_COMPOSE),)
DOCKER_COMPOSE := $(shell which docker 2>/dev/null)
PREFIX := compose
else
PREFIX :=
endif

# DOCKER TASKS
up: ## Runs the containers in detached mode with default config
$(DOCKER_COMPOSE) $(PREFIX) up -d --build

clean: ## Stops and removes all containers
$(DOCKER_COMPOSE) $(PREFIX) down

logs: ## View the logs from the containers
$(DOCKER_COMPOSE) $(PREFIX) logs -f

0 comments on commit c7e8e39

Please sign in to comment.