Merge pull request #991 from mwhudson/installdeps-commit
install curtin at commit specified in snapcraft.yaml for CI
This commit is contained in:
commit
89664a2446
|
@ -63,8 +63,9 @@ logs/*
|
|||
venv
|
||||
.pybuild
|
||||
|
||||
# probert as its pulled externally, ignore top level only.
|
||||
# top level dependencies fetched from git, ignore top level only.
|
||||
/probert/
|
||||
/curtin/
|
||||
|
||||
# installer isos
|
||||
*.iso
|
||||
|
|
21
Makefile
21
Makefile
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
NAME=subiquity
|
||||
PYTHONSRC=$(NAME)
|
||||
PYTHONPATH=$(shell pwd):$(shell pwd)/probert
|
||||
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/simple.json
|
||||
|
@ -25,7 +25,7 @@ install_deps:
|
|||
sudo apt-get install -y python3-urwid python3-pyudev python3-nose python3-flake8 \
|
||||
python3-yaml python3-coverage python3-dev pkg-config libnl-genl-3-dev \
|
||||
libnl-route-3-dev python3-attr python3-distutils-extra python3-requests \
|
||||
python3-requests-unixsocket python3-jsonschema python3-curtin python3-apport \
|
||||
python3-requests-unixsocket python3-jsonschema python3-apport \
|
||||
python3-bson xorriso isolinux python3-aiohttp probert cloud-init ssh-import-id
|
||||
|
||||
i18n:
|
||||
|
@ -50,20 +50,23 @@ flake8:
|
|||
@echo 'tox -e flake8' is preferred to 'make flake8'
|
||||
$(PYTHON) -m flake8 $(CHECK_DIRS) --exclude gettext38.py,contextlib38.py
|
||||
|
||||
unit:
|
||||
unit: gitdeps
|
||||
python3 -m unittest discover
|
||||
|
||||
integration:
|
||||
integration: gitdeps
|
||||
echo "Running integration tests..."
|
||||
./scripts/runtests.sh
|
||||
|
||||
check: unit integration
|
||||
|
||||
probert:
|
||||
@if [ ! -d "$(PROBERTDIR)" ]; then \
|
||||
git clone -q $(PROBERT_REPO) $(PROBERTDIR); \
|
||||
(cd probert && $(PYTHON) setup.py build_ext -i); \
|
||||
fi
|
||||
curtin: snapcraft.yaml
|
||||
./scripts/update-part.py curtin
|
||||
|
||||
probert: snapcraft.yaml
|
||||
./scripts/update-part.py probert
|
||||
(cd probert && $(PYTHON) setup.py build_ext -i);
|
||||
|
||||
gitdeps: curtin probert
|
||||
|
||||
schema: probert
|
||||
@$(PYTHON) -m subiquity.cmd.schema > autoinstall-schema.json
|
||||
|
|
|
@ -13,4 +13,3 @@ requests
|
|||
requests-unixsocket
|
||||
yarl==1.5.1 # see https://github.com/aio-libs/aiohttp/issues/4972
|
||||
aiohttp
|
||||
-e git+https://github.com/canonical/probert@b697ab779e7e056301e779f4708a9f1ce51b0027#egg=probert
|
||||
|
|
|
@ -11,6 +11,9 @@ ConditionPathExists=/dev/zfs
|
|||
EOF
|
||||
cp -r /etc/systemd/system/zfs-mount.service.d/ /etc/systemd/system/zfs-share.service.d/
|
||||
systemctl daemon-reload
|
||||
apt-get install -o APT::Get::Always-Include-Phased-Updates=true -y --no-install-recommends libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libsystemd-dev python3-distutils-extra pkg-config python3.5 python3-pip git lsb-release python3-setuptools gcc python3-dev python3-wheel curtin pep8 python3-pyflakes python3-bson make
|
||||
apt-get install -o APT::Get::Always-Include-Phased-Updates=true -y --no-install-recommends libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libsystemd-dev python3-distutils-extra pkg-config python3.5 python3-pip git lsb-release python3-setuptools gcc python3-dev python3-wheel pep8 python3-pyflakes python3-bson make
|
||||
pip3 install -r requirements.txt
|
||||
python3 setup.py build
|
||||
|
||||
make gitdeps
|
||||
|
||||
PYTHONPATH=.:./curtin:./probert python3 setup.py build
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/python3
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
part = sys.argv[1]
|
||||
|
||||
|
||||
def r(*args, **kw):
|
||||
print('running', args)
|
||||
subprocess.run(args, check=True, **kw)
|
||||
|
||||
|
||||
def o(*args, **kw):
|
||||
return subprocess.run(args, check=True, stdout=subprocess.PIPE).stdout
|
||||
|
||||
|
||||
with open("snapcraft.yaml") as f:
|
||||
config = yaml.safe_load(f)["parts"][part]
|
||||
|
||||
|
||||
c = "master"
|
||||
for k in "source-commit", "source-tag", "source-branch":
|
||||
if k in config:
|
||||
c = config[k]
|
||||
break
|
||||
|
||||
if not os.path.isdir(part):
|
||||
r('git', 'clone', config['source'], part)
|
||||
|
||||
expected = o('git', '-C', part, 'rev-parse', c)
|
||||
actual = o('git', '-C', part, 'rev-parse', 'HEAD')
|
||||
|
||||
if expected != actual:
|
||||
try:
|
||||
r('git', '-c', 'advice.detachedHead=false', '-C', part, 'checkout', c)
|
||||
except subprocess.CalledProcessError:
|
||||
r('git', '-C', part, 'fetch', config['source'])
|
||||
r('git', '-c', 'advice.detachedHead=false', '-C', part, 'checkout', c)
|
Loading…
Reference in New Issue