forked from ocf/ircbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (35 loc) · 1.04 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
DOCKER_REVISION ?= testing-$(USER)
DOCKER_TAG = docker-push.ocf.berkeley.edu/ircbot:$(DOCKER_REVISION)
RANDOM_PORT ?= $(shell expr $$(( 8010 + (`id -u` % 1000))))
.PHONY: test
test: venv install-hooks mypy
venv/bin/pre-commit run --all-files
.PHONY: mypy
mypy: venv
venv/bin/mypy -p ircbot
.PHONY: install-hooks
install-hooks: venv
venv/bin/pre-commit install -f --install-hooks
venv: vendor/venv-update requirements.txt requirements-dev.txt
vendor/venv-update \
venv= -ppython3.7 venv \
install= -r requirements.txt -r requirements-dev.txt
.PHONY: dev
dev: export HTTP_PORT ?= $(RANDOM_PORT)
dev: venv
@echo "\e[1m\e[93mRunning help on http://$(shell hostname -f ):$(RANDOM_PORT)/\e[0m"
venv/bin/python -m ircbot.ircbot
.PHONY: clean
clean:
rm -rf venv
.PHONY: cook-image
cook-image:
# TODO: make ocflib an argument
docker build --pull -t $(DOCKER_TAG) .
.PHONY: push-image
push-image:
docker push $(DOCKER_TAG)
.PHONY: update-requirements
update-requirements: venv
venv/bin/upgrade-requirements
sed -i 's/^ocflib==.*/ocflib/' requirements.txt