Buiding telegraf rpm

there is no make target for building rpm packages, so how to do it?

root@lpgaixmgmtlx01:/scratch/go/dev/src/github.com/influxdata/telegraf>make help
all - download dependencies and compile telegraf binary
deps - download dependencies
telegraf - compile telegraf binary
test - run short unit tests
fmt - format source files
tidy - tidy go modules
lint - run linter
lint-branch - run linter on changes in current branch since master
lint-install - install linter
check-deps - check docs/LICENSE_OF_DEPENDENCIES.md
clean - delete build artifacts

Package Targets:

Due to a recent refactor for faster CI builds, there is currently an issue with make help so it doesn’t provide you with the information you need: Update Makefile package process to default build all · Issue #9261 · influxdata/telegraf · GitHub

At the moment how it works, to build an rpm package it will be based on the architecture you want you need to enable the architecture by defining a variable like so amd64=1 make package. This will result in the following packages built:
telegraf-1.19_freebsd_amd64.tar.gz, telegraf-1.19_linux_amd64.tar.gz, telegraf_1.19_amd64.deb, telegraf-1.19.x86_64.rpm

Hopefully that helps! This should improve in the future, and we will be sure to add better documentation for this. A reference for available architectures can be found in the circleci config

1 Like