From 40b0d63dcb01c9386f58ce5917fb027c14799910 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Wed, 2 Oct 2024 16:06:42 +0000 Subject: T973: Add build script for node_exporter package --- .github/workflows/trigger_rebuild_packages.yml | 6 ++++++ scripts/package-build/node_exporter/.gitignore | 7 +++++++ scripts/package-build/node_exporter/build.py | 1 + scripts/package-build/node_exporter/package.toml | 21 +++++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 scripts/package-build/node_exporter/.gitignore create mode 120000 scripts/package-build/node_exporter/build.py create mode 100644 scripts/package-build/node_exporter/package.toml diff --git a/.github/workflows/trigger_rebuild_packages.yml b/.github/workflows/trigger_rebuild_packages.yml index 2be662e8..5fb755a5 100644 --- a/.github/workflows/trigger_rebuild_packages.yml +++ b/.github/workflows/trigger_rebuild_packages.yml @@ -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: @@ -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 diff --git a/scripts/package-build/node_exporter/.gitignore b/scripts/package-build/node_exporter/.gitignore new file mode 100644 index 00000000..0e010f4d --- /dev/null +++ b/scripts/package-build/node_exporter/.gitignore @@ -0,0 +1,7 @@ +node_exporter/ +*.buildinfo +*.build +*.changes +*.deb +*.dsc + diff --git a/scripts/package-build/node_exporter/build.py b/scripts/package-build/node_exporter/build.py new file mode 120000 index 00000000..3c76af73 --- /dev/null +++ b/scripts/package-build/node_exporter/build.py @@ -0,0 +1 @@ +../build.py \ No newline at end of file diff --git a/scripts/package-build/node_exporter/package.toml b/scripts/package-build/node_exporter/package.toml new file mode 100644 index 00000000..b0070278 --- /dev/null +++ b/scripts/package-build/node_exporter/package.toml @@ -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 " \ + --description "Prometheus exporter for machine metrics" \ + --license Apache-2.0 -C debian --package .. +""" -- cgit v1.2.3