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-10-08 19:02:55 +00:00
|
|
|
DRYRUN?=--dry-run --bootloader uefi --machine-config examples/simple.json \
|
2022-08-08 13:03:52 +00:00
|
|
|
--source-catalog examples/install-sources.yaml \
|
|
|
|
--postinst-hooks-dir examples/postinst.d/
|
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
|
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: all
|
2015-07-06 15:55:49 +00:00
|
|
|
all: dryrun
|
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: aptdeps
|
2021-08-10 19:05:08 +00:00
|
|
|
aptdeps:
|
|
|
|
sudo apt update && \
|
2022-03-04 17:34:49 +00:00
|
|
|
sudo apt-get install -y $(shell cat apt-deps.txt)
|
2018-02-14 22:40:50 +00:00
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: install_deps
|
2021-08-10 19:05:08 +00:00
|
|
|
install_deps: aptdeps gitdeps
|
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: i18n
|
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-12-13 19:20:32 +00:00
|
|
|
.PHONY: dryrun ui-view
|
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-12-13 19:20:32 +00:00
|
|
|
.PHONY: dryrun-console-conf ui-view-console-conf
|
2021-05-25 22:59:22 +00:00
|
|
|
dryrun-console-conf ui-view-console-conf:
|
|
|
|
$(PYTHON) -m console_conf.cmd.tui --dry-run $(MACHARGS)
|
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: dryrun-serial ui-view-serial
|
2021-05-25 22:59:22 +00:00
|
|
|
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-12-13 19:20:32 +00:00
|
|
|
.PHONY: dryrun-server
|
2021-05-25 22:59:22 +00:00
|
|
|
dryrun-server:
|
|
|
|
$(PYTHON) -m subiquity.cmd.server $(DRYRUN)
|
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: dryrun-system-setup
|
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
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: dryrun-system-setup-server
|
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-12-13 19:20:32 +00:00
|
|
|
.PHONY: dryrun-system-setup-recon
|
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
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: dryrun-system-setup-server-recon
|
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
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: lint
|
2018-06-05 20:38:28 +00:00
|
|
|
lint: flake8
|
2018-05-21 19:52:38 +00:00
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: flake8
|
2018-06-05 20:38:28 +00:00
|
|
|
flake8:
|
|
|
|
@echo 'tox -e flake8' is preferred to 'make flake8'
|
2021-10-05 04:05:34 +00:00
|
|
|
$(PYTHON) -m flake8 $(CHECK_DIRS)
|
2015-06-25 21:49:29 +00:00
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: unit
|
2021-07-04 21:22:01 +00:00
|
|
|
unit: gitdeps
|
2023-03-10 22:58:05 +00:00
|
|
|
timeout 120 \
|
2021-12-08 16:31:35 +00:00
|
|
|
$(PYTHON) -m pytest --ignore curtin --ignore probert \
|
2021-09-27 20:34:18 +00:00
|
|
|
--ignore subiquity/tests/api
|
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: api
|
2021-12-01 18:55:44 +00:00
|
|
|
api: gitdeps
|
2022-01-25 22:23:38 +00:00
|
|
|
$(PYTHON) -m pytest -n auto subiquity/tests/api
|
2021-05-17 13:31:29 +00:00
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: integration
|
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-12-13 19:20:32 +00:00
|
|
|
.PHONY: check
|
2021-09-27 20:34:18 +00:00
|
|
|
check: unit integration api
|
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-12-13 19:20:32 +00:00
|
|
|
.PHONY: gitdeps
|
2021-07-02 01:48:45 +00:00
|
|
|
gitdeps: curtin probert
|
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: schema
|
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
|
2021-09-08 15:53:27 +00:00
|
|
|
@$(PYTHON) -m system_setup.cmd.schema > autoinstall-system-setup-schema.json
|
2020-03-29 22:05:51 +00:00
|
|
|
|
2021-12-13 19:20:32 +00:00
|
|
|
.PHONY: clean
|
2015-06-15 19:12:26 +00:00
|
|
|
clean:
|
2017-09-22 18:28:55 +00:00
|
|
|
./debian/rules clean
|