mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
commit
005d65868a
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -29,3 +29,5 @@ command-line-arguments.test
|
||||||
*BASE*
|
*BASE*
|
||||||
*LOCAL*
|
*LOCAL*
|
||||||
*REMOTE*
|
*REMOTE*
|
||||||
|
build/root
|
||||||
|
tools/dumper/dumper
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
language: go
|
language: go
|
||||||
|
|
||||||
|
go:
|
||||||
|
- 1.1
|
||||||
|
|
||||||
# Explicitly stop before_script from doing anything by giving 'em nil work.
|
# Explicitly stop before_script from doing anything by giving 'em nil work.
|
||||||
before_script:
|
before_script:
|
||||||
- echo "Before Script"
|
- echo "Before Script"
|
||||||
|
@ -13,6 +16,4 @@ install:
|
||||||
script:
|
script:
|
||||||
- echo "Script"
|
- echo "Script"
|
||||||
- cd ${TRAVIS_BUILD_DIR}
|
- cd ${TRAVIS_BUILD_DIR}
|
||||||
- gvm install go1.1 || true
|
|
||||||
- gvm use go1.1 || true
|
|
||||||
- bash -l ./tests-for-die-in-a-fire-travis.sh
|
- bash -l ./tests-for-die-in-a-fire-travis.sh
|
||||||
|
|
20
Makefile
20
Makefile
|
@ -18,17 +18,15 @@ include Makefile.INCLUDE
|
||||||
all: binary test
|
all: binary test
|
||||||
|
|
||||||
advice:
|
advice:
|
||||||
go tool vet .
|
$(GO) tool vet .
|
||||||
|
|
||||||
binary: build
|
binary: build
|
||||||
go build -o prometheus $(BUILDFLAGS) .
|
$(GO) build -o prometheus $(BUILDFLAGS) .
|
||||||
|
|
||||||
build: preparation config model tools web
|
build: preparation config model tools web
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) -C build clean
|
$(MAKE) -C build clean
|
||||||
$(MAKE) -C config clean
|
|
||||||
$(MAKE) -C model clean
|
|
||||||
$(MAKE) -C tools clean
|
$(MAKE) -C tools clean
|
||||||
$(MAKE) -C web clean
|
$(MAKE) -C web clean
|
||||||
rm -rf $(TEST_ARTIFACTS)
|
rm -rf $(TEST_ARTIFACTS)
|
||||||
|
@ -43,7 +41,14 @@ documentation: search_index
|
||||||
godoc -http=:6060 -index -index_files='search_index'
|
godoc -http=:6060 -index -index_files='search_index'
|
||||||
|
|
||||||
format:
|
format:
|
||||||
find . -iname '*.go' | egrep -v "generated|\.(l|y)\.go" | xargs -n1 gofmt -w -s=true
|
find . -iname '*.go' | egrep -v "generated|\.(l|y)\.go" | xargs -n1 $(GOFMT) -w -s=true
|
||||||
|
|
||||||
|
build/cache/$(GOPKG):
|
||||||
|
curl -o $@ http://go.googlecode.com/files/$(GOPKG)
|
||||||
|
|
||||||
|
$(GOCC): build/cache/$(GOPKG)
|
||||||
|
tar -C build/root -xzf $<
|
||||||
|
touch $@
|
||||||
|
|
||||||
model: preparation
|
model: preparation
|
||||||
$(MAKE) -C model
|
$(MAKE) -C model
|
||||||
|
@ -52,7 +57,7 @@ package: binary
|
||||||
cp prometheus build/package/prometheus
|
cp prometheus build/package/prometheus
|
||||||
rsync -av build/root/lib/ build/package/lib/
|
rsync -av build/root/lib/ build/package/lib/
|
||||||
|
|
||||||
preparation: source_path
|
preparation: $(GOCC) source_path
|
||||||
$(MAKE) -C build
|
$(MAKE) -C build
|
||||||
|
|
||||||
race_condition_binary: build
|
race_condition_binary: build
|
||||||
|
@ -77,7 +82,8 @@ source_path:
|
||||||
[ -d "$(FULL_GOPATH)" ]
|
[ -d "$(FULL_GOPATH)" ]
|
||||||
|
|
||||||
test: build
|
test: build
|
||||||
go test ./... $(GO_TEST_FLAGS)
|
$(GOENV) find . -maxdepth 1 -mindepth 1 -type d -and -not -path ./build -exec $(GOCC) test {}/... $(GO_TEST_FLAGS) \;
|
||||||
|
$(GO) test $(GO_TEST_FLAGS)
|
||||||
|
|
||||||
tools:
|
tools:
|
||||||
$(MAKE) -C tools
|
$(MAKE) -C tools
|
||||||
|
|
|
@ -25,15 +25,28 @@ else
|
||||||
export THIRD_PARTY_BUILD_OUTPUT :=
|
export THIRD_PARTY_BUILD_OUTPUT :=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
OS=$(shell uname)
|
||||||
|
ARCH=$(shell uname -m)
|
||||||
|
|
||||||
GO_VERSION := 1.1
|
GO_VERSION := 1.1
|
||||||
|
GOOS = $(subst Darwin,darwin,$(subst Linux,linux,$(OS)))
|
||||||
|
GOARCH = $(subst x86_64,amd64,$(ARCH))
|
||||||
|
GOPKG = go$(GO_VERSION).$(GOOS)-$(GOARCH).tar.gz
|
||||||
|
GOROOT = $(PWD)/build/root/go
|
||||||
|
GOPATH = $(PWD)/build/root/gopath
|
||||||
|
GOCC = $(GOROOT)/bin/go
|
||||||
|
TMPDIR = /tmp
|
||||||
|
GOENV = TMPDIR=$(TMPDIR) GOROOT=$(GOROOT) GOPATH=$(GOPATH)
|
||||||
|
GO = $(GOENV) $(GOCC)
|
||||||
|
GOFMT = $(GOENV) $(GOROOT)/bin/gofmt
|
||||||
|
|
||||||
LEVELDB_VERSION := 1.9.0
|
LEVELDB_VERSION := 1.9.0
|
||||||
PROTOCOL_BUFFERS_VERSION := 2.5.0
|
PROTOCOL_BUFFERS_VERSION := 2.5.0
|
||||||
SNAPPY_VERSION := 1.1.0
|
SNAPPY_VERSION := 1.1.0
|
||||||
|
|
||||||
UNAME := $(shell uname)
|
UNAME := $(shell uname)
|
||||||
FIRST_GOPATH := $(shell echo $${GOPATH} | awk -F':' '{ print $$1 }')
|
FULL_GOPATH := $(GOPATH)/src/github.com/prometheus/prometheus
|
||||||
FULL_GOPATH := $(FIRST_GOPATH)/src/github.com/prometheus/prometheus
|
FULL_GOPATH_BASE := $(GOPATH)/src/github.com/prometheus
|
||||||
FULL_GOPATH_BASE := $(FIRST_GOPATH)/src/github.com/prometheus
|
|
||||||
|
|
||||||
export PREFIX=$(PWD)/build/root
|
export PREFIX=$(PWD)/build/root
|
||||||
|
|
||||||
|
@ -50,7 +63,7 @@ export PKG_CONFIG_PATH := $(PREFIX)/lib/pkgconfig:$(PKG_CONFIG_PATH)
|
||||||
|
|
||||||
export GO_TEST_FLAGS := "-v"
|
export GO_TEST_FLAGS := "-v"
|
||||||
|
|
||||||
GO_GET := go get -u -v -x
|
GO_GET := $(GO) get -u -v -x
|
||||||
APT_GET_INSTALL := sudo apt-get install -y
|
APT_GET_INSTALL := sudo apt-get install -y
|
||||||
BREW_INSTALL := brew install
|
BREW_INSTALL := brew install
|
||||||
# By default, wget sets the creation time to match the server's, which throws
|
# By default, wget sets the creation time to match the server's, which throws
|
||||||
|
|
1
build/.gitignore
vendored
Normal file
1
build/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
root/
|
|
@ -45,18 +45,18 @@ cc-implementation-Linux-stamp:
|
||||||
[ -x "$$(which cc)" ] || $(APT_GET_INSTALL) build-essential
|
[ -x "$$(which cc)" ] || $(APT_GET_INSTALL) build-essential
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
dependencies-stamp: cache-stamp go-stamp goprotobuf-stamp gorest-stamp goskiplist-stamp instrumentation-stamp levigo-stamp
|
dependencies-stamp: cache-stamp go-stamp goprotobuf-protoc-gen-go-stamp gorest-stamp goskiplist-stamp instrumentation-stamp levigo-stamp
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
go-stamp: gvm-stamp
|
go-stamp:
|
||||||
[ -x "$$(which go)" ] || { echo "go not found." ; false ; }
|
[ -x "$$(which go)" ] || { echo "go not found." ; false ; }
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
goprotobuf-protoc-gen-go-stamp: protoc-stamp
|
goprotobuf-protoc-gen-go-stamp: protoc-stamp goprotobuf-stamp
|
||||||
$(GO_GET) code.google.com/p/goprotobuf/protoc-gen-go $(THIRD_PARTY_BUILD_OUTPUT)
|
$(GO_GET) code.google.com/p/goprotobuf/protoc-gen-go $(THIRD_PARTY_BUILD_OUTPUT)
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
goprotobuf-stamp: go-stamp mercurial-stamp
|
goprotobuf-stamp: go-stamp protoc-stamp mercurial-stamp
|
||||||
$(GO_GET) code.google.com/p/goprotobuf/proto $(THIRD_PARTY_BUILD_OUTPUT)
|
$(GO_GET) code.google.com/p/goprotobuf/proto $(THIRD_PARTY_BUILD_OUTPUT)
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
|
@ -68,29 +68,6 @@ goskiplist-stamp: go-stamp
|
||||||
$(GO_GET) github.com/ryszard/goskiplist/skiplist $(THIRD_PARTY_BUILD_OUTPUT)
|
$(GO_GET) github.com/ryszard/goskiplist/skiplist $(THIRD_PARTY_BUILD_OUTPUT)
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
gvm-stamp: bison-stamp cc-stamp mercurial-stamp
|
|
||||||
[ -x "$$(which gvm)" ] || { echo "gvm not found; install manually from https://github.com/moovweb/gvm." ; false ; }
|
|
||||||
#
|
|
||||||
# ********** **********
|
|
||||||
# gvm installed go$(GO_VERSION) if it did not exist already.
|
|
||||||
#
|
|
||||||
# Prometheus expects go$(GO_VERSION) to be used for building.
|
|
||||||
# This can be achieved by running ``gvm use go$(GO_VERSION)`` before any
|
|
||||||
# other Prometheus make tools.
|
|
||||||
#
|
|
||||||
# Once this build finishes, $(GOPATH) will be mutated and
|
|
||||||
# contain some new packages. Here is an example workflow:
|
|
||||||
#
|
|
||||||
# $ gvm install go$(GO_VERSION)
|
|
||||||
# $ gvm use go$(GO_VERSION)
|
|
||||||
# $ gvm pkgset create prometheus
|
|
||||||
# $ gvm pkgset use prometheus
|
|
||||||
#
|
|
||||||
# ********** **********
|
|
||||||
#
|
|
||||||
-[ -z "${CI}" ] && read -p "Press [ENTER] upon reading." _
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
instrumentation-stamp: go-stamp
|
instrumentation-stamp: go-stamp
|
||||||
$(GO_GET) github.com/prometheus/client_golang/prometheus $(THIRD_PARTY_BUILD_OUTPUT)
|
$(GO_GET) github.com/prometheus/client_golang/prometheus $(THIRD_PARTY_BUILD_OUTPUT)
|
||||||
$(GO_GET) github.com/prometheus/client_golang/prometheus/exp $(THIRD_PARTY_BUILD_OUTPUT)
|
$(GO_GET) github.com/prometheus/client_golang/prometheus/exp $(THIRD_PARTY_BUILD_OUTPUT)
|
||||||
|
@ -182,6 +159,7 @@ clean:
|
||||||
$(MAKE) -C cache clean
|
$(MAKE) -C cache clean
|
||||||
$(MAKE) -C dirty clean
|
$(MAKE) -C dirty clean
|
||||||
$(MAKE) -C root clean
|
$(MAKE) -C root clean
|
||||||
|
$(MAKE) -C package clean
|
||||||
rm -rf *-stamp
|
rm -rf *-stamp
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,4 @@
|
||||||
# A helper until https://github.com/travis-ci/travis-cookbooks/issues/184 is
|
# A helper until https://github.com/travis-ci/travis-cookbooks/issues/184 is
|
||||||
# remedied.
|
# remedied.
|
||||||
|
|
||||||
. ./tests-for-die-in-a-fire-travis.shlib
|
|
||||||
|
|
||||||
make -f Makefile || exit 1
|
make -f Makefile || exit 1
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright 2013 Prometheus Team
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
# A helper until https://github.com/travis-ci/travis-cookbooks/issues/184 is
|
|
||||||
# remedied.
|
|
||||||
|
|
||||||
gvm install go1.1
|
|
||||||
gvm use go1.1
|
|
||||||
|
|
||||||
go version
|
|
||||||
go env
|
|
|
@ -24,6 +24,7 @@ pruner:
|
||||||
$(MAKE) -C pruner
|
$(MAKE) -C pruner
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) -C dumper pruner clean
|
$(MAKE) -C dumper clean
|
||||||
|
$(MAKE) -C pruner clean
|
||||||
|
|
||||||
.PHONY: clean dumper pruner
|
.PHONY: clean dumper pruner
|
||||||
|
|
1
tools/dumper/.gitignore
vendored
Normal file
1
tools/dumper/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
dumper
|
|
@ -20,7 +20,7 @@ SUFFIXES:
|
||||||
include ../../Makefile.INCLUDE
|
include ../../Makefile.INCLUDE
|
||||||
|
|
||||||
dumper: $(shell find . -iname '*.go')
|
dumper: $(shell find . -iname '*.go')
|
||||||
go build -o dumper .
|
$(GO) build -o dumper .
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(MAKE_ARTIFACTS)
|
rm -rf $(MAKE_ARTIFACTS)
|
||||||
|
|
|
@ -20,7 +20,7 @@ SUFFIXES:
|
||||||
include ../../Makefile.INCLUDE
|
include ../../Makefile.INCLUDE
|
||||||
|
|
||||||
pruner: $(shell find . -iname '*.go')
|
pruner: $(shell find . -iname '*.go')
|
||||||
go build -o pruner .
|
$(GO) build -o pruner .
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(MAKE_ARTIFACTS)
|
rm -rf $(MAKE_ARTIFACTS)
|
||||||
|
|
|
@ -11,12 +11,14 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
include ../../Makefile.INCLUDE
|
||||||
|
|
||||||
all: files.go
|
all: files.go
|
||||||
|
|
||||||
SUFFIXES:
|
SUFFIXES:
|
||||||
|
|
||||||
files.go: $(shell find ../templates/ ../static/ -type f)
|
files.go: $(shell find ../templates/ ../static/ -type f)
|
||||||
../../utility/embed-static.sh ../static ../templates | gofmt > $@
|
../../utility/embed-static.sh ../static ../templates | $(GOFMT) > $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm files.go
|
-rm files.go
|
||||||
|
|
Loading…
Reference in a new issue