Skip to content

Commit 6ac3a98

Browse files
deathowlcarlpett
authored andcommitted
Enable crossbuilds via promu (#1)
Add promu for builds
1 parent 7357ac4 commit 6ac3a98

File tree

288 files changed

+131351
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+131351
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.build

.promu.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
go: 1.6.3
2+
verbose: false
3+
repository:
4+
path: github.com/deathowl/zookeeper_exporter
5+
build:
6+
prefix: .
7+
binaries:
8+
- name: zookeeper_exporter
9+
path: .
10+
flags: -a -tags netgo
11+
ldflags: |
12+
-s
13+
-X {{repoPath}}/version.Version={{.Version}}
14+
-X {{repoPath}}/version.Revision={{.Revision}}
15+
-X {{repoPath}}/version.Branch={{.Branch}}
16+
-X {{repoPath}}/version.BuildUser={{user}}@{{host}}
17+
-X {{repoPath}}/version.BuildDate={{date "20060829-15:04:05"}}
18+
tarball:
19+
prefix: .
20+
crossbuild:
21+
platforms:
22+
- linux/amd64
23+
- linux/386
24+
- darwin/amd64
25+
- darwin/386
26+
- windows/amd64
27+
- windows/386
28+
- freebsd/amd64
29+
- freebsd/386
30+
- openbsd/amd64
31+
- openbsd/386
32+
- netbsd/amd64
33+
- netbsd/386
34+
- dragonfly/amd64
35+
- linux/arm
36+
- linux/arm64
37+
- freebsd/arm
38+
- openbsd/arm
39+
- netbsd/arm
40+
- linux/ppc64
41+
- linux/ppc64le
42+
- linux/mips64
43+
- linux/mips64le

Makefile

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copyright 2015 The Prometheus Authors
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
GO := GO15VENDOREXPERIMENT=1 go
15+
FIRST_GOPATH := $(firstword $(subst :, ,$(GOPATH)))
16+
PROMU := $(FIRST_GOPATH)/bin/promu
17+
pkgs = $(shell $(GO) list ./... | grep -v /vendor/)
18+
19+
PREFIX ?= $(shell pwd)
20+
BIN_DIR ?= $(shell pwd)
21+
DOCKER_IMAGE_NAME ?= zk_exporter
22+
DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))
23+
24+
ifdef DEBUG
25+
bindata_flags = -debug
26+
endif
27+
28+
29+
all: format build
30+
31+
style:
32+
@echo ">> checking code style"
33+
@! gofmt -d $(shell find . -path ./vendor -prune -o -name '*.go' -print) | grep '^'
34+
35+
format:
36+
@echo ">> formatting code"
37+
@$(GO) fmt $(pkgs)
38+
39+
vet:
40+
@echo ">> vetting code"
41+
@$(GO) vet $(pkgs)
42+
43+
build: promu
44+
@echo ">> building binaries"
45+
@$(PROMU) build --prefix $(PREFIX)
46+
47+
tarball: promu
48+
@echo ">> building release tarball"
49+
@$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR)
50+
51+
docker:
52+
@echo ">> building docker image"
53+
@docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" .
54+
55+
promu:
56+
@GOOS=$(shell uname -s | tr A-Z a-z) \
57+
GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \
58+
$(GO) get -u github.com/prometheus/promu
59+
60+
61+
.PHONY: all style format build vet tarball docker promu

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0

vendor/github.com/Sirupsen/logrus/CHANGELOG.md

Lines changed: 66 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/Sirupsen/logrus/LICENSE

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)