T6949: Adds build for blackbox exporter deb package

This commit is contained in:
Nicolas Vollmar 2024-12-30 19:30:48 +01:00 committed by GitHub
parent d6dfdfcc2f
commit d6fab6c8c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 75 additions and 0 deletions

View File

@ -29,6 +29,8 @@ jobs:
- 'scripts/package-build/amazon-ssm-agent/**'
aws-gwlbtun:
- 'scripts/package-build/aws-gwlbtun/**'
blackbox_exporter:
- 'scripts/package-build/blackbox_exporter/**'
ddclient:
- 'scripts/package-build/ddclient/**'
dropbear:

View File

@ -0,0 +1 @@
/blackbox_exporter/

View File

@ -0,0 +1 @@
../build.py

View File

@ -0,0 +1,66 @@
#!/bin/sh
CWD=$(pwd)
set -e
BUILD_ARCH=$(dpkg-architecture -qDEB_TARGET_ARCH)
SRC="blackbox_exporter"
if [ ! -d ${SRC} ]; then
echo "Source directory does not exist, please 'git clone'"
exit 1
fi
cd $SRC
mkdir -p debian
echo "I: Create $SRC/debian/control"
cat <<EOF > debian/control
Source: blackbox-exporter
Section: net
Priority: optional
Maintainer: VyOS Package Maintainers <maintainers@vyos.net>
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.5.1
Homepage: https://github.com/prometheus/blackbox_exporter
Package: blackbox-exporter
Architecture: ${BUILD_ARCH}
Depends: \${shlibs:Depends}, \${misc:Depends}
Description: The blackbox exporter allows blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP, ICMP and gRPC.
EOF
echo "I: Create $SRC/debian/changelog"
cat <<EOF > debian/changelog
blackbox-exporter (0.25.0) UNRELEASED; urgency=medium
* Upstream package
-- VyOS Maintainers <maintainers@vyos.io> Thu, 26 Sep 2024 12:35:47 +0000
EOF
echo "I: Create $SRC/debian/rules"
cat <<EOF > debian/rules
#!/usr/bin/make -f
clean:
@# Do nothing
build:
@# Do nothing
binary:
mkdir -p debian/blackbox-exporter
mkdir -p debian/blackbox-exporter/usr/sbin
mkdir -p debian/blackbox-exporter/run/blackbox_exporter
cp blackbox_exporter debian/blackbox-exporter/usr/sbin/blackbox_exporter
dh_gencontrol
dh_builddeb
EOF
chmod +x debian/rules
echo "I: Build blackbox_exporter"
go build
echo "I: Build Debian Package"
dpkg-buildpackage -uc -us -tc -b -d

View File

@ -0,0 +1,5 @@
[[packages]]
name = "blackbox_exporter"
commit_id = "v0.25.0"
scm_url = "https://github.com/prometheus/blackbox_exporter"
build_cmd = "cd ..; y | ./build.sh"