forked from canonical/subiquity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
101 lines (79 loc) · 2.11 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# Makefile for subiquity
#
NAME=subiquity
PYTHONSRC=$(NAME)
PYTHONPATH=$(shell pwd):$(shell pwd)/probert:$(shell pwd)/curtin
PROBERTDIR=./probert
PROBERT_REPO=https://github.com/canonical/probert
DRYRUN?=--dry-run --bootloader uefi --machine-config examples/machines/simple.json \
--source-catalog examples/sources/install.yaml \
--postinst-hooks-dir examples/postinst.d/
export PYTHONPATH
CWD := $(shell pwd)
CHECK_DIRS := console_conf subiquity subiquitycore
PYTHON := python3
ifneq (,$(MACHINE))
MACHARGS=--machine=$(MACHINE)
endif
.PHONY: all
all: dryrun
.PHONY: aptdeps
aptdeps:
sudo apt update && \
sudo apt-get install -y $(shell cat apt-deps.txt)
.PHONY: install_deps
install_deps: aptdeps gitdeps
.PHONY: i18n
i18n:
$(PYTHON) setup.py build_i18n
cd po; intltool-update -r -g subiquity
.PHONY: dryrun ui-view
dryrun ui-view: probert i18n
$(PYTHON) -m subiquity $(DRYRUN) $(MACHARGS)
.PHONY: dryrun-console-conf ui-view-console-conf
dryrun-console-conf ui-view-console-conf:
$(PYTHON) -m console_conf.cmd.tui --dry-run $(MACHARGS)
.PHONY: dryrun-serial ui-view-serial
dryrun-serial ui-view-serial:
(TERM=att4424 $(PYTHON) -m subiquity $(DRYRUN) --serial)
.PHONY: dryrun-server
dryrun-server:
$(PYTHON) -m subiquity.cmd.server $(DRYRUN)
.PHONY: lint
lint: flake8
.PHONY: flake8
flake8:
$(PYTHON) -m flake8 $(CHECK_DIRS)
.PHONY: unit
unit: gitdeps
timeout 120 \
$(PYTHON) -m pytest --ignore curtin --ignore probert \
--ignore subiquity/tests/api
.PHONY: api
api: gitdeps
$(PYTHON) -m pytest -n auto subiquity/tests/api
.PHONY: integration
integration: gitdeps
echo "Running integration tests..."
./scripts/runtests.sh
.PHONY: check
check: unit integration api
curtin: snapcraft.yaml
./scripts/update-part.py curtin
probert: snapcraft.yaml
./scripts/update-part.py probert
(cd probert && $(PYTHON) setup.py build_ext -i);
.PHONY: gitdeps
gitdeps: curtin probert
.PHONY: schema
schema: gitdeps
@$(PYTHON) -m subiquity.cmd.schema > autoinstall-schema.json
.PHONY: format black isort
format:
env -u PYTHONPATH tox -e black,isort
black isort:
env -u PYTHONPATH tox -e $@
.PHONY: clean
clean:
./debian/rules clean