forked from Syncano/rabbitmq_exporter
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reworked the build process using promu and travis.
- Loading branch information
Showing
26 changed files
with
1,143 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.build/ | ||
.tarballs/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.build | ||
dependencies-stamp | ||
rabbitmq_exporter | ||
rabbitmq_exporter.exe | ||
rabbitmq_exporter.exe | ||
.tarballs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
go: 1.6.2 | ||
verbose: true | ||
repository: | ||
path: github.com/kbudde/rabbitmq_exporter | ||
build: | ||
flags: -a -tags netgo | ||
ldflags: | | ||
-X main.Version={{.Version}} | ||
-X main.Revision={{.Revision}} | ||
-X main.Branch={{.Branch}} | ||
-X main.BuildDate={{date "20060102-15:04:05"}} | ||
tarball: | ||
files: | ||
- LICENSE | ||
crossbuild: | ||
platforms: | ||
- linux/amd64 | ||
- linux/386 | ||
- darwin/amd64 | ||
- darwin/386 | ||
- windows/amd64 | ||
- windows/386 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
FROM sdurrheimer/alpine-golang-make-onbuild | ||
FROM scratch | ||
MAINTAINER Kris Budde <[email protected]> | ||
EXPOSE 9090 | ||
|
||
COPY rabbitmq_exporter / | ||
|
||
EXPOSE 9090 | ||
|
||
CMD ["/rabbitmq_exporter"] |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,65 @@ | ||
VERSION := 0.10.0 | ||
TARGET := rabbitmq_exporter | ||
ROOTPKG := github.com/kbudde/$(TARGET) | ||
# Copyright 2016 The Prometheus Authors | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
include Makefile.COMMON | ||
GO := go | ||
PROMU := $(GOPATH)/bin/promu | ||
pkgs = $(shell $(GO) list ./... | grep -v /vendor/) | ||
|
||
PREFIX ?= $(shell pwd) | ||
BIN_DIR ?= $(shell pwd) | ||
DOCKER_IMAGE_NAME ?= rabbitmq-exporter | ||
DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD)) | ||
|
||
docker: | ||
cd $(SELFLINK) && CGO_ENABLED=0 GOOS=linux $(GO) build -a -installsuffix cgo -o $(TARGET)_static && docker build -f Dockerfile.scratch -t $(TARGET):scratch . | ||
|
||
all: format build test | ||
|
||
style: | ||
@echo ">> checking code style" | ||
@! gofmt -d $(shell find . -path ./vendor -prune -o -name '*.go' -print) | grep '^' | ||
|
||
test: | ||
@echo ">> running tests" | ||
@$(GO) test -short $(pkgs) | ||
|
||
format: | ||
@echo ">> formatting code" | ||
@$(GO) fmt $(pkgs) | ||
|
||
vet: | ||
@echo ">> vetting code" | ||
@$(GO) vet $(pkgs) | ||
|
||
build: promu | ||
@echo ">> building binaries" | ||
@$(PROMU) build --prefix $(PREFIX) | ||
|
||
tarball: promu | ||
@echo ">> building release tarball" | ||
@$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR) | ||
|
||
tarballs: promu | ||
@echo ">> building crossbuild" | ||
@$(PROMU) crossbuild | ||
@echo ">> building crossbuild tarballs" | ||
@$(PROMU) crossbuild tarballs | ||
|
||
docker: build | ||
@echo ">> building docker image" | ||
@docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . | ||
|
||
promu: | ||
@GOOS=$(shell uname -s | tr A-Z a-z) \ | ||
GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \ | ||
$(GO) get -v github.com/prometheus/promu | ||
|
||
.PHONY: docker | ||
.PHONY: all style format build test vet tarball tarballs docker promu |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.