summaryrefslogtreecommitdiff
path: root/scripts/package-build/telegraf/build.sh
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-08-26 15:21:14 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2024-08-29 09:30:52 +0000
commitcc7d0993b420c3245e628a818f887411d72530ff (patch)
tree53fd8ab2b5dea74c1f7969b8ff853179d81f8fec /scripts/package-build/telegraf/build.sh
parent70bb3c5baacb6e0c72b9532f6dda417d395a6bc0 (diff)
downloadvyos-build-cc7d0993b420c3245e628a818f887411d72530ff.tar.gz
vyos-build-cc7d0993b420c3245e628a818f887411d72530ff.zip
T6674: Add build-scrips for packages without Jenkins
Add build scripts for .deb packages without Jenkins. To exclude Jenkins we need some place where we can put new builds-scripts to run in parallel (old/new) during meantime We will deprecate old Jenkins package builds in the future.
Diffstat (limited to 'scripts/package-build/telegraf/build.sh')
-rwxr-xr-xscripts/package-build/telegraf/build.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/package-build/telegraf/build.sh b/scripts/package-build/telegraf/build.sh
new file mode 100755
index 00000000..2ba511d0
--- /dev/null
+++ b/scripts/package-build/telegraf/build.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+CWD=$(pwd)
+set -e
+
+BUILD_ARCH=$(dpkg-architecture -qDEB_TARGET_ARCH)
+
+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 ${BUILD_ARCH} package"
+cd ${SRC}
+export PATH=/opt/go/bin:$PATH
+
+# Generate default telegraf config
+go run ./cmd/telegraf config > etc/telegraf.conf
+LDFLAGS=-w make "${BUILD_ARCH}.deb"