2023-07-29 03:14:41 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
pipeline:
|
|
|
|
|
|
|
|
compile:
|
|
|
|
image: golang:1.19
|
|
|
|
group: test
|
|
|
|
commands:
|
|
|
|
- go get -v
|
|
|
|
- make prometheus-dnssec-exporter .changes
|
|
|
|
|
|
|
|
golangci-lint:
|
|
|
|
image: golang:1.19
|
|
|
|
group: test
|
|
|
|
commands:
|
|
|
|
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2
|
|
|
|
- golangci-lint run
|
|
|
|
|
|
|
|
build_debian:
|
|
|
|
image: debian:bookworm
|
|
|
|
group: package
|
|
|
|
when:
|
|
|
|
- event: tag
|
|
|
|
commands:
|
|
|
|
- apt update; apt install -y lintian sudo curl git
|
|
|
|
- export EXPORTER_VERSION=$(git describe --tags --dirty | sed -re s/^v// | cut -d- -f1)
|
|
|
|
- mkdir -p package/debian/prometheus-dnssec-exporter/usr/share/doc/prometheus-dnssec-exporter
|
|
|
|
- |
|
|
|
|
(for ref in $(git tag --sort=-refname | grep -v v0.0.0); do
|
2023-07-29 04:15:03 +02:00
|
|
|
echo -e "prometheus-dnssec-exporter ($(echo "$${ref}" | sed -re s/^v//)) stable; urgency=medium\n"
|
2023-07-29 03:14:41 +02:00
|
|
|
git log --format=' * %s' "$(git describe --tags --abbrev=0 $${ref}^)..$${ref}"
|
|
|
|
DATE="$(git log --tags --simplify-by-decoration --pretty='format:%aD' "$${ref}^..$${ref}")"
|
|
|
|
echo -e "\n -- s3lph <s3lph@kabelsalat.ch> $${DATE}\n"
|
|
|
|
done) > package/debian/prometheus-dnssec-exporter/usr/share/doc/prometheus-dnssec-exporter/changelog
|
|
|
|
- gzip -9n package/debian/prometheus-dnssec-exporter/usr/share/doc/prometheus-dnssec-exporter/changelog
|
|
|
|
- mkdir -p package/debian/prometheus-dnssec-exporter/usr/bin
|
|
|
|
- cp prometheus-dnssec-exporter package/debian/prometheus-dnssec-exporter/usr/bin
|
|
|
|
- cd package/debian/prometheus-dnssec-exporter
|
|
|
|
- find . -exec chown root:root {} \;
|
|
|
|
- find . -type f -exec chmod 0644 {} \;
|
|
|
|
- find . -type d -exec chmod 755 {} \;
|
|
|
|
- chmod +x usr/bin/prometheus-dnssec-exporter DEBIAN/postinst DEBIAN/prerm
|
|
|
|
- sed -re "s/__VERSION__/$${EXPORTER_VERSION}-1/g" -i DEBIAN/control
|
|
|
|
- cd ..
|
|
|
|
- dpkg-deb --build prometheus-dnssec-exporter
|
|
|
|
- mv "prometheus-dnssec-exporter.deb" "prometheus-dnssec-exporter_$${EXPORTER_VERSION}-1_all.deb"
|
|
|
|
- sudo -u nobody lintian "prometheus-dnssec-exporter_$${EXPORTER_VERSION}-1_all.deb" || true
|
|
|
|
- >-
|
|
|
|
curl
|
|
|
|
--user "$${GITEA_API_USERNAME}:$${GITEA_API_PASSWORD}"
|
|
|
|
--upload-file "prometheus-dnssec-exporter_$${EXPORTER_VERSION}-1_all.deb"
|
|
|
|
$${GITEA_API_REPOSITORY_DEB}
|