Skip to content

Commit

Permalink
Add goreleaser config
Browse files Browse the repository at this point in the history
  • Loading branch information
Hagai Barel committed Nov 13, 2018
1 parent 3ccff23 commit f3a8edc
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
# Folders to ignore
bin/
vendor/
.vscode/
.vscode/
dist/
35 changes: 35 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# .goreleaser.yml
builds:
- main: emq_exporter.go
binary: emq_exporter
goos:
- windows
- darwin
- linux
goarch:
- amd64
env:
- CGO_ENABLED=0
flags:
- -tags=netgo
ldflags:
- -s -w

archive:
name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}"
format: tar.gz
wrap_in_directory: true
format_overrides:
- goos: windows
format: zip
replacements:
darwin: macos

dockers:
- binary: emq_exporter
goos: linux
goarch: amd64
dockerfile: Dockerfile
image_templates:
- "nuvo/{{ .ProjectName }}:latest"
- "nuvo/{{ .ProjectName }}:{{ .Tag }}"
18 changes: 17 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
language: go

go:
- 1.11.2
- 1.11.2

services:
- docker

after_success:
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0; fi
- test -n "$TRAVIS_TAG" && docker login -u $DOCKER_USER -p $DOCKER_PASSWORD

# calls goreleaser
deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM quay.io/prometheus/busybox:latest

COPY bin/emq_exporter /bin/emq_exporter
COPY emq_exporter /bin/emq_exporter

EXPOSE 9505

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@

[![Release](https://img.shields.io/github/release/nuvo/emq_exporter.svg)](https://github.com/nuvo/emq_exporter/releases)
[![Travis branch](https://img.shields.io/travis/nuvo/emq_exporter/master.svg)](https://travis-ci.org/emq_exporter/ocra)
[![Docker Pulls](https://img.shields.io/docker/pulls/nuvo/emq_exporter.svg)](https://hub.docker.com/r/nuvo/emq_exporter/)
[![Go Report Card](https://goreportcard.com/badge/github.com/nuvo/emq_exporter)](https://goreportcard.com/report/github.com/nuvo/emq_exporter)
[![license](https://img.shields.io/github/license/nuvo/emq_exporter.svg)](https://github.com/nuvo/emq_exporter/blob/master/LICENSE)

# EMQ exporter for Prometheus

This is a simple server that scrapes EMQ metrics and exporters them via HTTP for
Expand Down

0 comments on commit f3a8edc

Please sign in to comment.