Build pmm-agent binary using release Makefile target. See https://github.com/percona/pmm-agent/blob/master/Makefile. Essentially:
Get binary from bin/pmm-agent. Of course, it is better to use common building code instead of copy-and-pasting this snippet. In the same time, do not use shared code that uses go get, go build, go install or dep. make release is going to be a common way to build binaries with proper flags and embedded version information across core PMM components (some exporters will be a different story).
Also, add those exporters (just binaries without any configs or examples is good enough):
If it is easier to add just binaries – do that. If it is easier to add packages – do that. We will rework that part later when we decide how to build exporters as external products.
Add single empty file config.yml. Put it into pmm-submodules repository. Install it to <insert proper path there, /usr/local/percona/something> only if this file is not present. Do not replace it or change permissions otherwise.
Add pmm-agent user for those binaries and config file without any special privileges. We might add special capabilities(7) later, but right now we need nothing.
Add systemd unit for starting pmm-agent without any arguments. Replace that unit on every install. We will add a single flag --config=<proper config path> later. No sed will be required. (We skip RHEL 6 without systemd for now.)