Skip to content

Commit

Permalink
Move presubmit to a make rule. Update docs to not use make all unless…
Browse files Browse the repository at this point in the history
… necessary.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
  • Loading branch information
vishh committed Jul 12, 2016
1 parent c1f3340 commit 2eecea1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 38 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion build/jenkins_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
22 changes: 0 additions & 22 deletions build/presubmit.sh

This file was deleted.

2 changes: 1 addition & 1 deletion deploy/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
set -e
set -x

make
make build

docker build -t google/cadvisor:beta .
15 changes: 3 additions & 12 deletions docs/development/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand All @@ -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:
Expand All @@ -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
```

0 comments on commit 2eecea1

Please sign in to comment.