diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-07-09 10:45:58 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-07-09 11:09:39 +0200 |
commit | 707fe34493e4f89a7aa310101f1bc2f2fbf7ec10 (patch) | |
tree | afd8745bd0e0fd4a161fef4693f34e2f584bf454 | |
parent | 9502f7aa3b991ef1597585492587b13ba18751bd (diff) | |
download | vyos-build-707fe34493e4f89a7aa310101f1bc2f2fbf7ec10.tar.gz vyos-build-707fe34493e4f89a7aa310101f1bc2f2fbf7ec10.zip |
telegraf: T4515: add custom build
-rw-r--r-- | packages/.gitignore | 5 | ||||
-rw-r--r-- | packages/telegraf/.gitignore | 1 | ||||
-rw-r--r-- | packages/telegraf/Jenkinsfile | 32 | ||||
-rwxr-xr-x | packages/telegraf/build.sh | 22 | ||||
-rw-r--r-- | packages/telegraf/plugins/inputs/all/all.go | 71 | ||||
-rw-r--r-- | packages/telegraf/plugins/outputs/all/all.go | 9 |
6 files changed, 140 insertions, 0 deletions
diff --git a/packages/.gitignore b/packages/.gitignore new file mode 100644 index 00000000..287672bb --- /dev/null +++ b/packages/.gitignore @@ -0,0 +1,5 @@ +*.deb +*.dsc +*.buildinfo +*.changes +*.git diff --git a/packages/telegraf/.gitignore b/packages/telegraf/.gitignore new file mode 100644 index 00000000..7e284c4f --- /dev/null +++ b/packages/telegraf/.gitignore @@ -0,0 +1 @@ +telegraf/ diff --git a/packages/telegraf/Jenkinsfile b/packages/telegraf/Jenkinsfile new file mode 100644 index 00000000..ccb80154 --- /dev/null +++ b/packages/telegraf/Jenkinsfile @@ -0,0 +1,32 @@ +// Copyright (C) 2020-2021 VyOS maintainers and contributors +// +// This program is free software; you can redistribute it and/or modify +// in order to easy exprort images built to "external" world +// it under the terms of the GNU General Public License version 2 or later as +// published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. +@NonCPS + +// Using a version specifier library, use 'current' branch. The underscore (_) +// is not a typo! You need this underscore if the line immediately after the +// @Library annotation is not an import statement! +@Library('vyos-build@current')_ + +// NOTE: we can build with -d as the libbpf dependency is installed manually +// and not via a DEB package +def pkgList = [ + ['name': 'telegraf', + 'scmCommit': 'v1.23.1', + 'scmUrl': 'https://github.com/influxdata/telegraf.git', + 'buildCmd': 'cd ..; ./build.sh'], +] + +// Start package build using library function from https://github.com/vyos/vyos-build +buildPackage('telegraf', pkgList, null, false, "**/packages/telegraf/*") diff --git a/packages/telegraf/build.sh b/packages/telegraf/build.sh new file mode 100755 index 00000000..77712412 --- /dev/null +++ b/packages/telegraf/build.sh @@ -0,0 +1,22 @@ +#!/bin/sh +CWD=$(pwd) +set -e + +SRC=telegraf +if [ ! -d ${SRC} ]; then + echo "Source directory does not exists, please 'git clone'" + exit 1 +fi + +PLUGIN_DIR=${CWD}/plugins + +echo "I: Selecting Input plugins" +cp ${PLUGIN_DIR}/inputs/all/all.go ${SRC}/plugins/inputs/all/all.go + +echo "I: Selecting Output plugins" +cp ${PLUGIN_DIR}/outputs/all/all.go ${SRC}/plugins/outputs/all/all.go + +echo "I: Build Debian amd64 package" +cd ${SRC} +export PATH=/opt/go/bin:$PATH +LDFLAGS=-w make amd64.deb diff --git a/packages/telegraf/plugins/inputs/all/all.go b/packages/telegraf/plugins/inputs/all/all.go new file mode 100644 index 00000000..0bc49cbd --- /dev/null +++ b/packages/telegraf/plugins/inputs/all/all.go @@ -0,0 +1,71 @@ +package all + +import ( + //Blank imports for plugins to register themselves + _ "github.com/influxdata/telegraf/plugins/inputs/azure_storage_queue" + _ "github.com/influxdata/telegraf/plugins/inputs/bond" + _ "github.com/influxdata/telegraf/plugins/inputs/cgroup" + _ "github.com/influxdata/telegraf/plugins/inputs/conntrack" + _ "github.com/influxdata/telegraf/plugins/inputs/cpu" + _ "github.com/influxdata/telegraf/plugins/inputs/disk" + _ "github.com/influxdata/telegraf/plugins/inputs/diskio" + _ "github.com/influxdata/telegraf/plugins/inputs/disque" + _ "github.com/influxdata/telegraf/plugins/inputs/dmcache" + _ "github.com/influxdata/telegraf/plugins/inputs/dns_query" + _ "github.com/influxdata/telegraf/plugins/inputs/docker" + _ "github.com/influxdata/telegraf/plugins/inputs/docker_log" + _ "github.com/influxdata/telegraf/plugins/inputs/ethtool" + _ "github.com/influxdata/telegraf/plugins/inputs/exec" + _ "github.com/influxdata/telegraf/plugins/inputs/execd" + _ "github.com/influxdata/telegraf/plugins/inputs/file" + _ "github.com/influxdata/telegraf/plugins/inputs/filecount" + _ "github.com/influxdata/telegraf/plugins/inputs/filestat" + _ "github.com/influxdata/telegraf/plugins/inputs/fireboard" + _ "github.com/influxdata/telegraf/plugins/inputs/hddtemp" + _ "github.com/influxdata/telegraf/plugins/inputs/hugepages" + _ "github.com/influxdata/telegraf/plugins/inputs/influxdb" + _ "github.com/influxdata/telegraf/plugins/inputs/influxdb_listener" + _ "github.com/influxdata/telegraf/plugins/inputs/influxdb_v2_listener" + _ "github.com/influxdata/telegraf/plugins/inputs/intel_pmu" + _ "github.com/influxdata/telegraf/plugins/inputs/intel_powerstat" + _ "github.com/influxdata/telegraf/plugins/inputs/intel_rdt" + _ "github.com/influxdata/telegraf/plugins/inputs/internal" + _ "github.com/influxdata/telegraf/plugins/inputs/internet_speed" + _ "github.com/influxdata/telegraf/plugins/inputs/interrupts" + _ "github.com/influxdata/telegraf/plugins/inputs/ipmi_sensor" + _ "github.com/influxdata/telegraf/plugins/inputs/ipset" + _ "github.com/influxdata/telegraf/plugins/inputs/iptables" + _ "github.com/influxdata/telegraf/plugins/inputs/ipvs" + _ "github.com/influxdata/telegraf/plugins/inputs/kernel" + _ "github.com/influxdata/telegraf/plugins/inputs/kernel_vmstat" + _ "github.com/influxdata/telegraf/plugins/inputs/mdstat" + _ "github.com/influxdata/telegraf/plugins/inputs/mem" + _ "github.com/influxdata/telegraf/plugins/inputs/net" + _ "github.com/influxdata/telegraf/plugins/inputs/netstat" + _ "github.com/influxdata/telegraf/plugins/inputs/ntpq" + _ "github.com/influxdata/telegraf/plugins/inputs/ping" + _ "github.com/influxdata/telegraf/plugins/inputs/powerdns_recursor" + _ "github.com/influxdata/telegraf/plugins/inputs/processes" + _ "github.com/influxdata/telegraf/plugins/inputs/procstat" + _ "github.com/influxdata/telegraf/plugins/inputs/sensors" + _ "github.com/influxdata/telegraf/plugins/inputs/sflow" + _ "github.com/influxdata/telegraf/plugins/inputs/slab" + _ "github.com/influxdata/telegraf/plugins/inputs/smart" + _ "github.com/influxdata/telegraf/plugins/inputs/snmp" + _ "github.com/influxdata/telegraf/plugins/inputs/snmp_legacy" + _ "github.com/influxdata/telegraf/plugins/inputs/snmp_trap" + _ "github.com/influxdata/telegraf/plugins/inputs/socket_listener" + _ "github.com/influxdata/telegraf/plugins/inputs/socketstat" + _ "github.com/influxdata/telegraf/plugins/inputs/syslog" + _ "github.com/influxdata/telegraf/plugins/inputs/sysstat" + _ "github.com/influxdata/telegraf/plugins/inputs/system" + _ "github.com/influxdata/telegraf/plugins/inputs/systemd_units" + _ "github.com/influxdata/telegraf/plugins/inputs/tail" + _ "github.com/influxdata/telegraf/plugins/inputs/tcp_listener" + _ "github.com/influxdata/telegraf/plugins/inputs/temp" + _ "github.com/influxdata/telegraf/plugins/inputs/twemproxy" + _ "github.com/influxdata/telegraf/plugins/inputs/udp_listener" + _ "github.com/influxdata/telegraf/plugins/inputs/wireguard" + _ "github.com/influxdata/telegraf/plugins/inputs/wireless" + _ "github.com/influxdata/telegraf/plugins/inputs/x509_cert" +) diff --git a/packages/telegraf/plugins/outputs/all/all.go b/packages/telegraf/plugins/outputs/all/all.go new file mode 100644 index 00000000..49f7e63d --- /dev/null +++ b/packages/telegraf/plugins/outputs/all/all.go @@ -0,0 +1,9 @@ +package all + +import ( + //Blank imports for plugins to register themselves + _ "github.com/influxdata/telegraf/plugins/outputs/azure_data_explorer" + _ "github.com/influxdata/telegraf/plugins/outputs/http" + _ "github.com/influxdata/telegraf/plugins/outputs/influxdb_v2" + _ "github.com/influxdata/telegraf/plugins/outputs/prometheus_client" +) |