build_prometheus_exporters.sh 560 B

1234567891011121314151617181920212223
  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. BIN_CAT=/usr/bin/cat
  10. export PATH=${HOME}/go/bin:${HOME}/app/bin:${HOME}/app/sbin:/opt/local/sbin:/opt/local/bin:$PATH
  11. for exporter in `${BIN_CAT} buildscripts/prometheus_exporters`; do
  12. ${BIN_GO} get ${exporter}
  13. ${BIN_GO} build ${exporter}
  14. ${BIN_GO} install ${exporter}
  15. done
  16. ${BIN_CP} ${HOME}/go/bin/* ${HOME}/app/bin/prometheus/.
  17. ${BIN_CHMOD} 0755 ${HOME}/app/bin/prometheus/*