build_prometheus_exporters.sh 539 B

12345678910111213141516171819202122
  1. #!/usr/bin/bash
  2. # Build Prometheus exporters
  3. umask 022
  4. BIN_RM=/usr/bin/rm
  5. BIN_MKDIR=/usr/bin/mkdir
  6. BIN_GO=/opt/local/bin/go
  7. BIN_CP=/usr/bin/cp
  8. BIN_CHMOD=/usr/bin/chmod
  9. export PATH=${HOME}/go/bin:${HOME}/app/bin:${HOME}/app/sbin:/opt/local/sbin:/opt/local/bin:$PATH
  10. for exporter in `${BIN_CAT} buildscripts/prometheus_exporters`; do
  11. ${BIN_GO} get ${exporter}
  12. ${BIN_GO} build ${exporter}
  13. ${BIN_GO} install ${exporter}
  14. done
  15. ${BIN_CP} ${HOME}/go/bin/* ${HOME}/app/bin/prometheus/.
  16. ${BIN_CHMOD} 0755 ${HOME}/app/bin/prometheus/*