From b3460ca1214f931ceb493e1ba32251f69b3471f2 Mon Sep 17 00:00:00 2001 From: rebortg Date: Tue, 8 Oct 2024 14:49:31 +0200 Subject: T973: add build script for frr_exporter package --- .github/workflows/trigger_rebuild_packages.yml | 6 ++++++ scripts/package-build/frr_exporter/.gitignore | 6 ++++++ scripts/package-build/frr_exporter/build.py | 1 + scripts/package-build/frr_exporter/package.toml | 22 ++++++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 scripts/package-build/frr_exporter/.gitignore create mode 120000 scripts/package-build/frr_exporter/build.py create mode 100644 scripts/package-build/frr_exporter/package.toml diff --git a/.github/workflows/trigger_rebuild_packages.yml b/.github/workflows/trigger_rebuild_packages.yml index 6429671a..4355ecb8 100644 --- a/.github/workflows/trigger_rebuild_packages.yml +++ b/.github/workflows/trigger_rebuild_packages.yml @@ -33,6 +33,8 @@ jobs: - 'scripts/package-build/ethtool/**' frr: - 'scripts/package-build/frr/**' + frr_exporter: + - 'scripts/package-build/frr_exporter/**' hostap: - 'scripts/package-build/hostap/**' hsflowd: @@ -117,6 +119,10 @@ jobs: trigger_build "frr" fi + if [ "${{ steps.changes.outputs.frr_exporter }}" == "true" ]; then + trigger_build "frr_exporter" + fi + if [ "${{ steps.changes.outputs.hostap }}" == "true" ]; then trigger_build "hostap" fi diff --git a/scripts/package-build/frr_exporter/.gitignore b/scripts/package-build/frr_exporter/.gitignore new file mode 100644 index 00000000..4880abf9 --- /dev/null +++ b/scripts/package-build/frr_exporter/.gitignore @@ -0,0 +1,6 @@ +frr_exporter / +*.buildinfo +*.build +*.changes +*.deb +*.dsc diff --git a/scripts/package-build/frr_exporter/build.py b/scripts/package-build/frr_exporter/build.py new file mode 120000 index 00000000..3c76af73 --- /dev/null +++ b/scripts/package-build/frr_exporter/build.py @@ -0,0 +1 @@ +../build.py \ No newline at end of file diff --git a/scripts/package-build/frr_exporter/package.toml b/scripts/package-build/frr_exporter/package.toml new file mode 100644 index 00000000..1c87d496 --- /dev/null +++ b/scripts/package-build/frr_exporter/package.toml @@ -0,0 +1,22 @@ +[[packages]] +name = "frr_exporter" +commit_id = "v1.3.1" +scm_url = "https://github.com/tynany/frr_exporter" + +build_cmd = """ + +# Create the install directory +mkdir -p debian/usr/sbin +make setup_promu +go build + +# Move the frr_exporter binary to the install directory +mv frr_exporter debian/usr/sbin + +# Build the Debian package +fpm --input-type dir --output-type deb --name frr-exporter \ + --version $(git describe --tags --always | cut -c2-) --deb-compression gz \ + --maintainer "VyOS Package Maintainers " \ + --description "Prometheus exporter for FRR" \ + --license Apache-2.0 -C debian --package .. +""" -- cgit v1.2.3