prometheus-tlsrpt-exporter/.woodpecker.yml
s3lph 264e9a5dcf
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Initial commit
2023-07-23 20:19:37 +02:00

51 lines
2.4 KiB
YAML

---
pipeline:
test:
image: python:3.11-bookworm
group: test
commands:
- pip3 install -e .[test]
- python3 -m unittest coverage run --rcfile=setup.cfg -m unittest discover pkgtls_exporter
- python3 -m unittest coverage combine
- python3 -m unittest coverage report --rcfile=setup.cfg
codestyle:
image: python:3.11-bookworm
group: test
commands:
- pip3 install -e .[test]
- pycodestyle pkgtls_exporter
build_wheel:
image: python:3.11-bookworm
group: package
commands:
- python3 setup.py egg_info bdist_wheel
- cd dist
- sha256sum *.whl > SHA256SUMS
build_debian:
image: python:3.11-bookworm
group: package
commands:
- apt update; apt install lintian
- export EXPORTER_VERSION=$(python3 -c 'import tlsrpt_exporter; print(tlsrpt_exporter.__version__)')
- mkdir -p package/debian/prometheus-tlsrpt-exporter/usr/share/prometheus-tlsrpt-exporter
- cp -r templates/ package/debian/prometheus-tlsrpt-exporter/usr/share/prometheus-tlsrpt-exporter/templates/
- python3 setup.py egg_info install --root=package/debian/prometheus-tlsrpt-exporter/ --prefix=/usr --optimize=1
- cd package/debian
- mkdir -p prometheus-tlsrpt-exporter/usr/lib/python3/dist-packages/
- rsync -a prometheus-tlsrpt-exporter/usr/lib/python3.11/site-packages/ matemat/usr/lib/python3/dist-packages/
- rm -rf prometheus-tlsrpt-exporter/usr/lib/python3.11/
- find prometheus-tlsrpt-exporter/usr/lib/python3/dist-packages -name __pycache__ -exec rm -r {} \; 2>/dev/null || true
- find prometheus-tlsrpt-exporter/usr/lib/python3/dist-packages -name '*.pyc' -exec rm {} \;
- sed -re 's$#!/usr/local/bin/python3.11$#!/usr/bin/python3$' -i prometheus-tlsrpt-exporter/usr/bin/prometheus-tlsrpt-exporter
- find prometheus-tlsrpt-exporter -type f -exec chmod 0644 {} \;
- find prometheus-tlsrpt-exporter -type d -exec chmod 755 {} \;
- chmod +x prometheus-tlsrpt-exporter/usr/bin/prometheus-tlsrpt-exporter prometheus-tlsrpt-exporter/DEBIAN/postinst prometheus-tlsrpt-exporter/DEBIAN/prerm
- dpkg-deb --build prometheus-tlsrpt-exporter
- mv prometheus-tlsrpt-exporter.deb "prometheus-tlsrpt-exporter_${EXPORTER_VERSION}-1_all.deb"
- sudo -u nobody lintian "prometheus-tlsrpt-exporter_${EXPORTER_VERSION}-1_all.deb"
- sha256sum *.deb > SHA256SUMS