This repository has been archived by the owner on May 17, 2022. It is now read-only.
forked from Rari-Capital/fuse-twap-bot
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
50 lines (38 loc) · 1.45 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
VENV_NAME := venv
PYTHON := $(VENV_NAME)/bin/python
ALCHEMY_VERSION := $(shell $(PYTHON) -c "import ALCHEMY;print(ALCHEMY.__version__)")
RM := rm -rf
ifdef ENV
include ${ENV}.env
endif
export
BOLD=$(shell tput -T xterm bold)
RED=$(shell tput -T xterm setaf 1)
GREEN=$(shell tput -T xterm setaf 2)
YELLOW=$(shell tput -T xterm setaf 3)
RESET=$(shell tput -T xterm sgr0)
help:
@awk 'BEGIN {FS = ":.*?##-.*?local.*?- "} /^[a-zA-Z_-]+:.*?##-.*?local.*?- / \
{printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@echo ""
@echo "${YELLOW}ENV=data${RESET}"
@awk 'BEGIN {FS = ":.*?##-.*?data.*?- "} /^[a-zA-Z_-]+:.*?##-.*?data.*?- / \
{printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@echo ""
@echo "${YELLOW}ENV=sandbox${RESET}"
@awk 'BEGIN {FS = ":.*?##-.*?sandbox.*?- "} /^[a-zA-Z_-]+:.*?##-.*?sandbox.*?- / \
{printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
check-%:
@if [ "${${*}}" = "" ]; then \
echo -e "${RED} Variable $* not set ❌${RESET}"; \
exit 1; \
fi
build: check-ENV
@docker build -t fuse-twap-bot . \
--build-arg ETHEREUM_ADMIN_ACCOUNT=${ETHEREUM_ADMIN_ACCOUNT} \
--build-arg ETHEREUM_ADMIN_PRIVATE_KEY=${ETHEREUM_ADMIN_PRIVATE_KEY} \
--build-arg SUPPORTED_PAIRS=${SUPPORTED_PAIRS} \
--build-arg ROOT_PRICE_ORACLE_CONTRACT_ADDRESS=${ROOT_PRICE_ORACLE_CONTRACT_ADDRESS} \
--build-arg WEB3_HTTP_PROVIDER_URL=${WEB3_HTTP_PROVIDER_URL}
run: check-ENV
docker run -e NODE_ENV=$ENV -it fuse-twap-bot