mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Update Readme for new Makefile
This commit is contained in:
parent
92ffeadb7b
commit
ad64474076
|
@ -4,7 +4,7 @@ MAINTAINER The Prometheus Authors <prometheus-developers@googlegroups.com>
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
RUN apk add --update -t build-deps git mercurial bzr make \
|
RUN apk add --update -t build-deps git make bash go \
|
||||||
&& make build \
|
&& make build \
|
||||||
&& cp prometheus promtool /bin/ \
|
&& cp prometheus promtool /bin/ \
|
||||||
&& mkdir -p /etc/prometheus \
|
&& mkdir -p /etc/prometheus \
|
||||||
|
|
52
README.md
52
README.md
|
@ -33,44 +33,34 @@ is the recommended way of installing Prometheus.
|
||||||
|
|
||||||
Debian and RPM packages are being worked on.
|
Debian and RPM packages are being worked on.
|
||||||
|
|
||||||
### Use `make`
|
### Building from source
|
||||||
|
|
||||||
Clone the repository in the usual way with `git clone`. (If you
|
To build Prometheus from the source code yourself you need to have a working
|
||||||
download and unpack the source archives provided by GitHub instead of
|
go environment with [version 1.5 or greater installed](http://golang.org/doc/install).
|
||||||
using `git clone`, you need to set an environment variable `VERSION`
|
|
||||||
to make the below work. See
|
|
||||||
[issue #609](https://github.com/prometheus/prometheus/issues/609) for
|
|
||||||
context.)
|
|
||||||
|
|
||||||
In most circumstances, the following should work:
|
You can directly use the `go` tool to download and install the `prometheus`
|
||||||
|
and `promtool` binaries into your `GOPATH`:
|
||||||
|
|
||||||
$ make build
|
$ go get github.com/prometheus/prometheus/...
|
||||||
$ ./prometheus -config.file=documentation/examples/prometheus.yml
|
$ prometheus -config.file=your_config.yml
|
||||||
|
|
||||||
The above requires a number of common tools to be installed, namely
|
You can also clone the repository yourself and build using `make`:
|
||||||
`curl`, `git`, `gzip`, `hg` (Mercurial CLI).
|
|
||||||
|
|
||||||
Everything else will be downloaded and installed into a staging
|
$ mkdir -p $GOPATH/src/github.com/prometheus
|
||||||
environment in the `.build` sub-directory. That includes a Go
|
$ cd $GOPATH/src/github.com/prometheus
|
||||||
development environment of the appropriate version.
|
$ git clone https://github.com/prometheus/prometheus.git
|
||||||
|
$ cd prometheus
|
||||||
|
$ make
|
||||||
|
$ ./prometheus -config.file=your_config.yml
|
||||||
|
|
||||||
The `Makefile` offers a number of useful targets. Some examples:
|
The makefile provides several targets:
|
||||||
|
|
||||||
* `make test` runs tests.
|
* *build*: build the `prometheus` and `promtool` binaries
|
||||||
* `make tarball` creates a tarball with the binary for distribution.
|
* *test*: run the tests
|
||||||
* `make race_condition_run` compiles and runs a binary with the race detector enabled. To pass arguments when running Prometheus this way, set the `ARGUMENTS` environment variable (e.g. `ARGUMENTS="-config.file=./prometheus.conf" make race_condition_run`).
|
* *format*: format the source code
|
||||||
|
* *vet*: check the source code for common errors
|
||||||
### Use your own Go development environment
|
* *assets*: rebuild the static assets
|
||||||
|
* *docker*: build a docker container for the current `HEAD`
|
||||||
Using your own Go development environment with the usual tooling is
|
|
||||||
possible, too. After making changes to the files in `web/static` you
|
|
||||||
have to run `make` in the `web/` directory. This generates the respective
|
|
||||||
`web/blob/files.go` file which embedds the static assets in the compiled binary.
|
|
||||||
|
|
||||||
Furthermore, the version information (see `version/info.go`) will not be
|
|
||||||
populated if you simply run `go build`. You have to pass in command
|
|
||||||
line flags as defined in `Makefile.INCLUDE` (see `${BUILDFLAGS}`) to
|
|
||||||
do that.
|
|
||||||
|
|
||||||
## More information
|
## More information
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue