2015-06-10 20:59:55 +00:00
|
|
|
#
|
|
|
|
# Makefile for subiquity
|
|
|
|
#
|
2015-08-21 18:15:04 +00:00
|
|
|
NAME=subiquity
|
|
|
|
PYTHONSRC=$(NAME)
|
2021-07-02 01:48:45 +00:00
|
|
|
PYTHONPATH=$(shell pwd):$(shell pwd)/probert:$(shell pwd)/curtin
|
2015-09-01 15:04:24 +00:00
|
|
|
PROBERTDIR=./probert
|
2021-02-18 21:33:38 +00:00
|
|
|
PROBERT_REPO=https://github.com/canonical/probert
|
2021-05-25 22:59:22 +00:00
|
|
|
DRYRUN?=--dry-run --bootloader uefi --machine-config examples/simple.json
|
2021-07-07 13:38:43 +00:00
|
|
|
SYSTEM_SETUP_DRYRUN?=--dry-run
|
2018-05-24 16:47:16 +00:00
|
|
|
export PYTHONPATH
|
2018-05-21 19:00:41 +00:00
|
|
|
CWD := $(shell pwd)
|
2015-08-28 18:19:13 +00:00
|
|
|
|
2021-08-12 12:01:44 +00:00
|
|
|
CHECK_DIRS := console_conf/ subiquity/ subiquitycore/ system_setup/
|
2018-06-05 20:38:28 +00:00
|
|
|
PYTHON := python3
|
|
|
|
|
2015-08-28 18:19:13 +00:00
|
|
|
ifneq (,$(MACHINE))
|
|
|
|
MACHARGS=--machine=$(MACHINE)
|
|
|
|
endif
|
|
|
|
|
2015-11-02 22:49:31 +00:00
|
|
|
.PHONY: run clean check
|
2015-06-17 20:36:32 +00:00
|
|
|
|
2015-07-06 15:55:49 +00:00
|
|
|
all: dryrun
|
|
|
|
|
2021-08-10 19:05:08 +00:00
|
|
|
aptdeps:
|
|
|
|
sudo apt update && \
|
2018-05-17 22:25:41 +00:00
|
|
|
sudo apt-get install -y python3-urwid python3-pyudev python3-nose python3-flake8 \
|
2018-02-15 00:27:56 +00:00
|
|
|
python3-yaml python3-coverage python3-dev pkg-config libnl-genl-3-dev \
|
2018-05-22 11:15:13 +00:00
|
|
|
libnl-route-3-dev python3-attr python3-distutils-extra python3-requests \
|
2021-07-02 01:48:45 +00:00
|
|
|
python3-requests-unixsocket python3-jsonschema python3-apport \
|
2021-08-10 19:05:08 +00:00
|
|
|
python3-bson xorriso isolinux python3-aiohttp cloud-init ssh-import-id \
|
2021-08-10 19:13:54 +00:00
|
|
|
curl jq build-essential
|
2018-02-14 22:40:50 +00:00
|
|
|
|
2021-08-10 19:05:08 +00:00
|
|
|
install_deps: aptdeps gitdeps
|
|
|
|
|
2018-02-14 22:40:50 +00:00
|
|
|
i18n:
|
2020-03-10 12:00:13 +00:00
|
|
|
$(PYTHON) setup.py build_i18n
|
2020-05-06 12:22:13 +00:00
|
|
|
cd po; intltool-update -r -g subiquity
|
2018-02-14 22:40:50 +00:00
|
|
|
|
2021-05-25 22:59:22 +00:00
|
|
|
dryrun ui-view: probert i18n
|
2018-06-06 18:30:03 +00:00
|
|
|
$(PYTHON) -m subiquity $(DRYRUN) $(MACHARGS)
|
2015-06-25 21:49:29 +00:00
|
|
|
|
2021-05-25 22:59:22 +00:00
|
|
|
dryrun-console-conf ui-view-console-conf:
|
|
|
|
$(PYTHON) -m console_conf.cmd.tui --dry-run $(MACHARGS)
|
|
|
|
|
|
|
|
dryrun-serial ui-view-serial:
|
2018-06-06 18:30:03 +00:00
|
|
|
(TERM=att4424 $(PYTHON) -m subiquity $(DRYRUN) --serial)
|
2015-06-30 21:53:12 +00:00
|
|
|
|
2021-05-25 22:59:22 +00:00
|
|
|
dryrun-server:
|
|
|
|
$(PYTHON) -m subiquity.cmd.server $(DRYRUN)
|
|
|
|
|
2021-07-06 07:26:37 +00:00
|
|
|
dryrun-system-setup:
|
2021-07-07 13:38:43 +00:00
|
|
|
$(PYTHON) -m system_setup.cmd.tui $(SYSTEM_SETUP_DRYRUN)
|
2021-07-06 07:26:37 +00:00
|
|
|
|
|
|
|
dryrun-system-setup-server:
|
2021-07-07 13:38:43 +00:00
|
|
|
$(PYTHON) -m system_setup.cmd.server $(SYSTEM_SETUP_DRYRUN)
|
2021-07-06 07:26:37 +00:00
|
|
|
|
2021-07-22 16:49:12 +00:00
|
|
|
dryrun-system-setup-recon:
|
2021-09-02 15:28:21 +00:00
|
|
|
DRYRUN_RECONFIG=true $(PYTHON) -m system_setup.cmd.tui $(SYSTEM_SETUP_DRYRUN)
|
2021-07-22 16:49:12 +00:00
|
|
|
|
|
|
|
dryrun-system-setup-server-recon:
|
2021-09-02 15:28:21 +00:00
|
|
|
DRYRUN_RECONFIG=true $(PYTHON) -m system_setup.cmd.server $(SYSTEM_SETUP_DRYRUN)
|
2021-07-22 16:49:12 +00:00
|
|
|
|
2018-06-05 20:38:28 +00:00
|
|
|
lint: flake8
|
2018-05-21 19:52:38 +00:00
|
|
|
|
2018-06-05 20:38:28 +00:00
|
|
|
flake8:
|
|
|
|
@echo 'tox -e flake8' is preferred to 'make flake8'
|
2020-09-11 04:54:04 +00:00
|
|
|
$(PYTHON) -m flake8 $(CHECK_DIRS) --exclude gettext38.py,contextlib38.py
|
2015-06-25 21:49:29 +00:00
|
|
|
|
2021-07-04 21:22:01 +00:00
|
|
|
unit: gitdeps
|
2021-05-17 13:31:29 +00:00
|
|
|
python3 -m unittest discover
|
|
|
|
|
2021-07-04 21:22:01 +00:00
|
|
|
integration: gitdeps
|
2021-05-17 13:31:29 +00:00
|
|
|
echo "Running integration tests..."
|
2020-11-09 12:40:39 +00:00
|
|
|
./scripts/runtests.sh
|
2015-06-15 19:12:26 +00:00
|
|
|
|
2021-05-17 13:31:29 +00:00
|
|
|
check: unit integration
|
2015-11-02 22:49:31 +00:00
|
|
|
|
2021-07-04 21:22:01 +00:00
|
|
|
curtin: snapcraft.yaml
|
|
|
|
./scripts/update-part.py curtin
|
2021-07-02 01:48:45 +00:00
|
|
|
|
2021-07-04 21:22:01 +00:00
|
|
|
probert: snapcraft.yaml
|
|
|
|
./scripts/update-part.py probert
|
|
|
|
(cd probert && $(PYTHON) setup.py build_ext -i);
|
2015-09-01 15:04:24 +00:00
|
|
|
|
2021-07-02 01:48:45 +00:00
|
|
|
gitdeps: curtin probert
|
|
|
|
|
2021-07-13 17:17:55 +00:00
|
|
|
schema: gitdeps
|
2021-03-03 18:24:33 +00:00
|
|
|
@$(PYTHON) -m subiquity.cmd.schema > autoinstall-schema.json
|
2020-03-29 22:05:51 +00:00
|
|
|
|
2015-06-15 19:12:26 +00:00
|
|
|
clean:
|
2017-09-22 18:28:55 +00:00
|
|
|
./debian/rules clean
|
2018-05-24 19:33:25 +00:00
|
|
|
|
2018-06-05 20:38:28 +00:00
|
|
|
.PHONY: flake8 lint
|