forked from bonfire-networks/bonfire_me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (43 loc) · 2.8 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.PHONY: setup updates db-reset build dev shell
LIBS_PATH=/forks/
mix-%: ## Run a specific mix command, eg: `make mix-deps.get` or make mix-deps.update args="pointers"
docker-compose run web mix $* $(args)
setup: build mix-setup ## First run - prepare environment and dependencies
updates: build mix-updates ## Update/prepare dependencies
db-reset: mix-ecto.reset ## Reset the DB
build: ## Build the docker image
docker-compose build
shell: ## Open a shell, in dev mode
docker-compose run --service-ports web bash
dep-hex-%: ## add/enable/disable/delete a hex dep with messctl command, eg: `make dep-hex-enable dep=pointers version="~> 0.2"
docker-compose run web messctl $* $(dep) $(version) deps.hex
dep-git-%: ## add/enable/disable/delete a git dep with messctl command, eg: `make dep-hex-enable dep=pointers repo=https://github.com/commonspub/pointers#main
docker-compose run web messctl $* $(dep) $(repo) deps.git
dep-local-%: ## add/enable/disable/delete a local dep with messctl command, eg: `make dep-hex-enable dep=pointers path=./libs/pointers
docker-compose run web messctl $* $(dep) $(path) deps.path
dep-clone-local: ## Clone a git dep and use the local version, eg: make dep-clone-local dep="pointers" repo=https://github.com/commonspub/pointers
git clone $(repo) $(LIBS_PATH)$(dep) 2> /dev/null || (cd $(LIBS_PATH)$(dep) ; git pull)
make dep-go-local dep=$(dep)
dep-go-local: ## Switch to using a standard local path, eg: make dep-go-local dep=pointers
make dep-go-local-path dep=$(dep) path=$(LIBS_PATH)$(dep)
dep-go-local-%: ## Switch to using a standard local path, eg: make dep-go-local dep=pointers
make dep-go-local dep="$*"
dep-go-local-path: ## Switch to using a local path, eg: make dep-go-local dep=pointers path=./libs/pointers
make dep-local-add dep=$(dep) path=$(path)
make dep-local-enable dep=$(dep) path=""
# make dep-git-disable dep=$(dep) repo=""
# make dep-hex-disable dep=$(dep) version=""
dep-go-git: ## Switch to using a git repo, eg: make dep-go-git dep="pointers" repo=https://github.com/commonspub/pointers (repo is optional if previously specified)
make dep-git-add dep=$(dep) $(repo) 2> /dev/null || true
make dep-git-enable dep=$(dep) repo=""
make dep-hex-disable dep=$(dep) version=""
make dep-local-disable dep=$(dep) path=""
dep-go-hex: ## Switch to using a library from hex.pm, eg: make dep-go-hex dep="pointers" version="~> 0.2" (version is optional if previously specified)
make dep-hex-add dep=$(dep) version=$(version) 2> /dev/null || true
make dep-hex-enable dep=$(dep) version=""
make dep-git-disable dep=$(dep) repo=""
make dep-local-disable dep=$(dep) path=""
dev: ## Run the app with Docker
docker-compose run --service-ports web
%: ## Run a specific mix command, eg: `make messclt` or `make "messctl help"` or make `messctl args="help"`
docker-compose run web $* $(args)