Move presubmit to a make rule. Update docs to not use make all unless necessary.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
This commit is contained in:
Vishnu kannan 2016-07-11 15:09:41 -07:00
parent c1f3340830
commit 2eecea1353
5 changed files with 13 additions and 38 deletions

View File

@ -14,7 +14,7 @@
GO := go
pkgs = $(shell $(GO) list ./... | grep -v vendor)
all: format vet build test
all: presubmit build test
test:
@echo ">> running tests"
@ -43,4 +43,10 @@ release:
docker:
@docker build -t cadvisor:$(shell git rev-parse --short HEAD) -f deploy/Dockerfile .
.PHONY: all build docker format release test test-integration vet
presubmit: vet
@echo ">> checking go formatting"
@./build/check_gofmt.sh .
@echo ">> checking file boilerplate"
@./build/check_boilerplate.sh
.PHONY: all build docker format release test test-integration vet presubmit

View File

@ -22,7 +22,7 @@ BUILDER=${BUILDER:-false} # Whether this is running a PR builder job.
export GO_FLAGS="-race"
export GORACE="halt_on_error=1"
./build/presubmit.sh
make
go build -tags test github.com/google/cadvisor/integration/runner
# Nodes that are currently stable. When tests fail on a specific node, and the failure is not remedied within a week, that node will be removed from this list.

View File

@ -1,22 +0,0 @@
#!/bin/bash
# Copyright 2015 Google Inc. All rights reserved.
#
# 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.
set -e
set -x
./build/check_gofmt.sh .
./build/check_boilerplate.sh
make

View File

@ -17,6 +17,6 @@
set -e
set -x
make
make build
docker build -t google/cadvisor:beta .

View File

@ -4,9 +4,9 @@
## Installing Dependencies
cAdvisor is written in the [Go](http://golang.org) programming language. If you haven't set up a Go development environment, please follow [these instructions](http://golang.org/doc/code.html) to install go tool and set up GOPATH. Ensure that your version of Go is at least 1.3. Note that the version of Go in package repositories of some operating systems is outdated, so please [download](https://golang.org/dl/) the latest version.
cAdvisor is written in the [Go](http://golang.org) programming language. If you haven't set up a Go development environment, please follow [these instructions](http://golang.org/doc/code.html) to install go tool and set up GOPATH. Note that the version of Go in package repositories of some operating systems is outdated, so please [download](https://golang.org/dl/) the latest version.
**Note**: cAdvisor requires Go 1.5 to build.
**Note**: cAdvisor requires Go 1.6 to build.
After setting up Go, you should be able to `go get` cAdvisor as expected (we use `-d` to only download):
@ -19,7 +19,7 @@ $ go get -d github.com/google/cadvisor
At this point you can build cAdvisor from the source folder:
```
$GOPATH/src/github.com/google/cadvisor $ make
$GOPATH/src/github.com/google/cadvisor $ make build
```
or run only unit tests:
@ -38,12 +38,3 @@ Now you can run the built binary:
$GOPATH/src/github.com/google/cadvisor $ sudo ./cadvisor
```
## Compiling Assets
If you modify files in the /assets folder, you will need to rebuild the assets:
```
$GOPATH/src/github.com/google/cadvisor $ ./build/assets.sh
$GOPATH/src/github.com/google/cadvisor $ make
```