-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Makefile
43 lines (36 loc) · 1.32 KB
/
Makefile
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
#The shell we use
SHELL := /bin/bash
# We like colors
# # From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
RED=`tput setaf 1`
GREEN=`tput setaf 2`
RESET=`tput sgr0`
YELLOW=`tput setaf 3`
# Vars
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
.PHONY: help
help: ## This help message
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
.PHONY: run-postgres
run-postgres: ## Run PostgreSQL
@echo ""
@echo "$(YELLOW)==> Running PostgreSQL $(VERSION)$(RESET)"
@docker run --rm -e POSTGRES_DB=guillotina -e POSTGRES_USER=postgres \
-p 127.0.0.1:5432:5432 --name postgres postgres:9.6
.PHONY: run-cockroachdb
run-cockroachdb: ## Run CockroachDB
@echo ""
@echo "$(YELLOW)==> Running CockroachDB $(VERSION)$(RESET)"
@docker run -p 127.0.0.1:26257:26257 -p 127.0.0.1:9080:8080 \
--rm cockroachdb/cockroach:v2.0.0 start --insecure
.PHONY: run-redis
run-redis: ## Run Redis
@echo ""
@echo "$(YELLOW)==> Running Redis"
@docker run -p 127.0.0.1:32958:6379 --rm redis:5.0.7
.PHONY: create-cockroachdb
create-cockroachdb: ## Create CockroachDB
@echo ""
@echo "$(YELLOW)==> Creating CockroachDB $(VERSION)$(RESET)"
./bin/python _cockroachdb-createdb.py