forked from canonical/ubuntu-pro-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (49 loc) · 2.09 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
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))
build:
$(MAKE) -C apt-hook build
clean:
rm -f *.build *.buildinfo *.changes .coverage *.deb *.dsc *.tar.gz *.tar.xz
rm -rf *.egg-info/ .tox/ .cache/ .mypy_cache/
find . -type f -name '*.pyc' -delete
find . -type d -name '*__pycache__' -delete
$(MAKE) -C apt-hook clean
demo:
@echo Creating contract-bionic-demo container with ua-contracts server
@./demo/demo-contract-service
deps:
@which mk-build-deps > /dev/null || { \
echo "Missing mk-build-deps; installing devscripts, equivs."; \
apt-get install --no-install-recommends --yes devscripts equivs; \
}
mk-build-deps --tool "apt-get --no-install-recommends --yes" \
--install --remove ${mkfile_dir}/debian/control
test:
@tox
testdeps:
ifneq (,$(findstring trusty,$(TOXENV)))
@echo Pinning virtualenv to 20.0.31 on trusty because 32 breaks py3.4
pip install virtualenv==20.0.31
endif
pip install tox
pip install tox-pip-version
travis-deb-install:
git fetch --unshallow
sudo apt-get update
sudo apt-get build-dep -y ubuntu-advantage-tools
sudo apt-get install -y --install-recommends sbuild ubuntu-dev-tools dh-systemd
# Missing build-deps
sudo apt-get install -y --install-recommends libapt-pkg-dev python3-mock python3-pytest
# Use the mirror for a GCE region, to speed things up. (Travis build VMs use
# DataSourceNone so we can't dynamically determine the correct region.)
travis-deb-script: export DEBOOTSTRAP_MIRROR=http://us-central1.gce.archive.ubuntu.com/ubuntu/
travis-deb-script:
debuild -S -uc -us
sudo sbuild-adduser ${USER}
cp /usr/share/doc/sbuild/examples/example.sbuildrc /home/${USER}/.sbuildrc
# Use this to get a new shell where we're in the sbuild group
sudo -E su ${USER} -c 'mk-sbuild ${PACKAGE_BUILD_SERIES}'
sudo -E su ${USER} -c 'sbuild --nolog --verbose --dist=${PACKAGE_BUILD_SERIES} ../ubuntu-advantage-tools*.dsc'
cp ./ubuntu-advantage-tools*.deb ubuntu-advantage-tools-${PACKAGE_BUILD_SERIES}.deb
cp ./ubuntu-advantage-pro*.deb ubuntu-advantage-tools-pro-${PACKAGE_BUILD_SERIES}.deb
.PHONY: build clean test testdeps demo