forked from python/buildmaster-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (45 loc) · 1.33 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
PYTHON_VERSION=3.9
SYSTEM_PYTHON=python$(PYTHON_VERSION)
VENV_DIR=./venv
PIP=$(VENV_DIR)/bin/pip
BUILDBOT=$(VENV_DIR)/bin/buildbot
VENV_CHECK=$(VENV_DIR)/lib/python$(PYTHON_VERSION)/site-packages/buildbot/master.py
LOGLINES=50
# Setup targets
.PHONY: venv regen-requirements
venv: $(VENV_CHECK)
clean:
rm -rf venv
$(VENV_CHECK): requirements.txt
$(SYSTEM_PYTHON) -m venv --clear venv
$(PIP) install -U pip 'setuptools<58.0' wheel
$(PIP) install -r requirements.txt
regen-requirements:
$(SYSTEM_PYTHON) -m venv --clear venv
$(PIP) install -U pip 'setuptools<58.0' wheel
$(PIP) install -U -r requirements.in
$(PIP) freeze > requirements.txt
# Test targets
.PHONY: check
check: $(VENV_CHECK)
$(BUILDBOT) checkconfig master/master.cfg
# Management targets
.PHONY: update-master start-master restart-master stop-master
update-master: stop-master
@if [ `git rev-parse --symbolic-full-name HEAD` = "refs/heads/main" ]; \
then \
git pull; \
else \
echo "Not on main, not pulling updates"; \
fi
$(MAKE) run-target TARGET=upgrade-master LOGLINES=0
$(MAKE) check
$(MAKE) start-master
start-master: TARGET=start
start-master: run-target
restart-master: TARGET=restart
restart-master: run-target
stop-master: TARGET=stop
stop-master: run-target
run-target: $(VENV_CHECK)
$(BUILDBOT) $(TARGET) master; tail -n$(LOGLINES) master/twistd.log