Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T973: add build script for frr_exporter package #804

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/trigger_rebuild_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions scripts/package-build/frr_exporter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
frr_exporter /
*.buildinfo
*.build
*.changes
*.deb
*.dsc
1 change: 1 addition & 0 deletions scripts/package-build/frr_exporter/build.py
22 changes: 22 additions & 0 deletions scripts/package-build/frr_exporter/package.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>" \
--description "Prometheus exporter for FRR" \
--license Apache-2.0 -C debian --package ..
"""
Loading