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
|
#!/usr/bin/make -f
include /usr/share/openstack-pkg-tools/pkgos.make
export TZ=UTC
%:
dh $@ --buildsystem=pybuild --with python3,sphinxdoc
override_dh_auto_clean:
python3 setup.py clean
rm -f debian/watcher-common.config debian/watcher-common.postinst debian/watcher-api.config debian/watcher-api.postinst
rm -rf debian/*.upstart debian/*.service
rm -rf debian/watcher-common.postrm debian/*.templates debian/po debian/*.init
rm -rf build .stestr doc/source/_static/watcher.conf.sample *.egg-info
find . -iname '*.pyc' -delete
for i in $$(find . -type d -iname __pycache__) ; do rm -rf $$i ; done
override_dh_auto_build:
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func watcher-common.config
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func watcher-common.postinst
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func watcher-api.config
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func watcher-api.postinst
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_postrm watcher-common.postrm
pkgos-merge-templates watcher-api watcher endpoint
pkgos-merge-templates watcher-common watcher db rabbit ksat
override_dh_auto_install:
echo "Do nothing..."
override_dh_install:
pkgos-dh_auto_install --no-py2 --in-tmp
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
pkgos-dh_auto_test --no-py2 --serial 'watcher\.tests\.api\.(?!.*test_hooks\.TestContextHook\.test_context_hook_before_method.*|.*v1\.test_audits\.TestPost\.test_create_continuous_audit_with_wrong_interval.*)'
pkgos-dh_auto_test --no-py2 --serial 'watcher\.tests\.applier.*'
pkgos-dh_auto_test --no-py2 --serial 'watcher\.tests\.cmd.*'
pkgos-dh_auto_test --no-py2 --serial 'watcher\.tests\.common\.(?!.*test_clients\.TestClients\.test_clients_ironic.*|.*metal_helper\.test_maas.*)'
pkgos-dh_auto_test --no-py2 --serial 'watcher\.tests\.conf.*'
pkgos-dh_auto_test --no-py2 --serial 'watcher\.tests\.db.*'
pkgos-dh_auto_test --no-py2 --serial 'watcher\.tests\.decision_engine.*'
pkgos-dh_auto_test --no-py2 --serial 'watcher\.tests\.notifications.*'
pkgos-dh_auto_test --no-py2 --serial 'watcher\.tests\.objects.*'
endif
rm -rf $(CURDIR)/debian/python3-watcher/usr/etc
mkdir -p $(CURDIR)/debian/watcher-common/usr/share/watcher-common
PYTHONPATH=$(CURDIR)/debian/python3-watcher/usr/lib/python3/dist-packages oslo-config-generator \
--output-file $(CURDIR)/debian/watcher-common/usr/share/watcher-common/watcher.conf \
--wrap-width 140 \
--namespace watcher \
--namespace keystonemiddleware.auth_token \
--namespace oslo.cache \
--namespace oslo.concurrency \
--namespace oslo.db \
--namespace oslo.log \
--namespace oslo.messaging \
--namespace oslo.policy \
--namespace oslo.reports \
--namespace oslo.service.periodic_task \
--namespace oslo.service.service \
--namespace oslo.service.wsgi
pkgos-readd-keystone-authtoken-missing-options $(CURDIR)/debian/watcher-common/usr/share/watcher-common/watcher.conf keystone_authtoken watcher
PYTHONPATH=$(CURDIR)/debian/python3-watcher/usr/lib/python3/dist-packages oslopolicy-sample-generator \
--output-file $(CURDIR)/debian/watcher-common/usr/share/watcher-common/policy.json \
--format json \
--namespace watcher
pkgos-fix-config-default $(CURDIR)/debian/watcher-common/usr/share/watcher-common/watcher.conf oslo_concurrency lock_path /var/lock/watcher
dh_install
dh_missing --fail-missing
rm -rf debian/python3-watcher/usr/etc
mkdir -p $(CURDIR)/debian/watcher-api/usr/bin
cp watcher/api/app.wsgi $(CURDIR)/debian/watcher-api/usr/bin/watcher-wsgi-api
# Disable https in default setup, as this makes our CI fail
pkgos-fix-config-default $(CURDIR)/debian/watcher-common/usr/share/watcher-common/watcher.conf keystone_authtoken auth_protocol http
# Fix the missing sql_connection directive
pkgos-fix-config-default $(CURDIR)/debian/watcher-common/usr/share/watcher-common/watcher.conf database sqlite:////var/lib/watcher/watcherdb
override_dh_auto_test:
echo "Do nothing..."
override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
set -e ; set -x ; if ! PYTHON=python3 PYTHONPATH=. python3 -m sphinx $(SPHINXOPTS) -b html doc/source $(CURDIR)/debian/watcher-doc/usr/share/doc/watcher-doc/html ; then \
cat /tmp/sphinx-err-*.log ; \
false ; \
fi
touch $(CURDIR)/debian/watcher-doc/usr/share/doc/watcher-doc/html/_static/toggle.js
dh_sphinxdoc
endif
override_dh_python3:
dh_python3 --shebang=/usr/bin/python3
|