-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
44 lines (35 loc) · 993 Bytes
/
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/slackbridge:$(DOCKER_REVISION)
.PHONY: test
test: venv install-hooks mypy
venv/bin/pre-commit run --all-files
.PHONY: mypy
mypy: venv
venv/bin/mypy -p slackbridge
.PHONY: dev
dev: venv
# Check if a local slackbridge.conf exists, and use it if it does
ifeq ($(wildcard slackbridge.conf),)
venv/bin/python -m slackbridge.main
else
venv/bin/python -m slackbridge.main -c slackbridge.conf
endif
.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: clean
clean:
rm -rf venv
.PHONY: update-requirements
update-requirements: venv
venv/bin/upgrade-requirements
.PHONY: cook-image
cook-image:
docker build -t $(DOCKER_TAG) .
.PHONY: push-image
push-image:
docker push $(DOCKER_TAG)