Skip to content

Commit

Permalink
T973: Add build script for node_exporter package
Browse files Browse the repository at this point in the history
  • Loading branch information
sever-sever committed Oct 2, 2024
1 parent 2b9303d commit 40b0d63
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/trigger_rebuild_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
- 'scripts/package-build/net-snmp/**'
netfilter:
- 'scripts/package-build/netfilter/**'
node_exporter:
- 'scripts/package-build/node_exporter/**'
opennhrp:
- 'scripts/package-build/opennhrp/**'
openvpn-otp:
Expand Down Expand Up @@ -149,6 +151,10 @@ jobs:
trigger_build "netfilter"
fi
if [ "${{ steps.changes.outputs.node_exporter }}" == "true" ]; then
trigger_build "node_exporter"
fi
if [ "${{ steps.changes.outputs.opennhrp }}" == "true" ]; then
trigger_build "opennhrp"
fi
Expand Down
7 changes: 7 additions & 0 deletions scripts/package-build/node_exporter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_exporter/
*.buildinfo
*.build
*.changes
*.deb
*.dsc

1 change: 1 addition & 0 deletions scripts/package-build/node_exporter/build.py
21 changes: 21 additions & 0 deletions scripts/package-build/node_exporter/package.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[[packages]]
name = "node_exporter"
commit_id = "v1.8.2"
scm_url = "https://github.com/prometheus/node_exporter"

build_cmd = """
# Create the install directory
mkdir -p debian/usr/sbin
make build
# Move the node_exporter binary to the install directory
mv node_exporter debian/usr/sbin
# Build the Debian package
fpm --input-type dir --output-type deb --name node-exporter \
--version $(git describe --tags --always | cut -c2-) --deb-compression gz \
--maintainer "VyOS Package Maintainers <[email protected]>" \
--description "Prometheus exporter for machine metrics" \
--license Apache-2.0 -C debian --package ..
"""

0 comments on commit 40b0d63

Please sign in to comment.