Skip to content

Commit

Permalink
update scripts and docs to not mention godep for builds
Browse files Browse the repository at this point in the history
Signed-off-by: Vishnu kannan <[email protected]>
  • Loading branch information
vishh committed Jul 11, 2016
1 parent de4af12 commit 38ea12a
Show file tree
Hide file tree
Showing 19 changed files with 28 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and

GO := godep go
GO := go
pkgs = $(shell $(GO) list ./...)

all: format build test
Expand Down
2 changes: 1 addition & 1 deletion build/boilerplate/boilerplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def file_passes(filename, refs, regexs):
def file_extension(filename):
return os.path.splitext(filename)[1].split(".")[-1].lower()

skipped_dirs = ['Godeps', 'third_party', '_gopath', '_output', '.git']
skipped_dirs = ['Godeps', 'vendor', 'third_party', '_gopath', '_output', '.git']
def normalize_files(files):
newfiles = []
for pathname in files:
Expand Down
2 changes: 1 addition & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ if [ "$RELEASE" == "true" ]; then
echo "Building release candidate with -ldflags $ldflags"
fi

GOBIN=$PWD godep go "$GO_CMD" ${GO_FLAGS} -ldflags "${ldflags}" "${repo_path}"
GOBIN=$PWD go "$GO_CMD" ${GO_FLAGS} -ldflags "${ldflags}" "${repo_path}"

exit 0
2 changes: 1 addition & 1 deletion build/check_errorf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

GO_FILES=$(find . -not -wholename "*Godeps*" -name "*.go")
GO_FILES=$(find . -not -wholename "*Godeps*" -not -wholename "*vendor*" -name "*.go")

for FILE in ${GO_FILES}; do
ERRS=`grep 'fmt.Errorf("[A-Z]' ${FILE}`
Expand Down
2 changes: 1 addition & 1 deletion build/check_gofmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if [ $# -ne 1 ]; then
fi

# Check formatting on non Godep'd code.
GOFMT_PATHS=$(find . -not -wholename "*.git*" -not -wholename "*Godeps*" -not -name "." -type d)
GOFMT_PATHS=$(find . -not -wholename "*.git*" -not -wholename "*Godeps*" -not -wholename "*vendor*" -not -name "." -type d)

# Find any files with gofmt problems
BAD_FILES=$(gofmt -s -l $GOFMT_PATHS)
Expand Down
2 changes: 1 addition & 1 deletion build/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ while [ "$(curl -Gs http://localhost:8080/healthz)" != "ok" ]; do
done

echo ">> running integration tests against local cAdvisor"
godep go test github.com/google/cadvisor/integration/tests/... --vmodule=*=2
go test github.com/google/cadvisor/integration/tests/... --vmodule=*=2
3 changes: 1 addition & 2 deletions build/jenkins_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ BUILDER=${BUILDER:-false} # Whether this is running a PR builder job.
export GO_FLAGS="-race"
export GORACE="halt_on_error=1"

go get -u github.com/tools/godep
./build/presubmit.sh
godep go build -tags test github.com/google/cadvisor/integration/runner
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.
golden_nodes=(
Expand Down
4 changes: 2 additions & 2 deletions build/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ set -x
./build/check_gofmt.sh .
./build/check_boilerplate.sh
go vet github.com/google/cadvisor/...
godep go test -v -race -test.short github.com/google/cadvisor/...
godep go build github.com/google/cadvisor
go test -v -race -test.short github.com/google/cadvisor/...
go build github.com/google/cadvisor
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

godep go build -a github.com/google/cadvisor
make

docker build -t google/cadvisor:beta .
3 changes: 1 addition & 2 deletions deploy/canary/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ MAINTAINER [email protected]

RUN apt-get install -y git dmsetup
RUN git clone https://github.com/google/cadvisor.git /go/src/github.com/google/cadvisor
RUN go get github.com/tools/godep
RUN cd /go/src/github.com/google/cadvisor && godep go build .
RUN cd /go/src/github.com/google/cadvisor && make

ENTRYPOINT ["/go/src/github.com/google/cadvisor/cadvisor"]

12 changes: 3 additions & 9 deletions docs/development/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,18 @@ After setting up Go, you should be able to `go get` cAdvisor as expected (we use
$ go get -d github.com/google/cadvisor
```

We use `godep` so you will need to get that as well:

```
$ go get github.com/tools/godep
```

## Building from Source

At this point you can build cAdvisor from the source folder:

```
$GOPATH/src/github.com/google/cadvisor $ godep go build .
$GOPATH/src/github.com/google/cadvisor $ make
```

or run only unit tests:

```
$GOPATH/src/github.com/google/cadvisor $ godep go test ./... -test.short
$GOPATH/src/github.com/google/cadvisor $ make test
```

For integration tests, see the [integration testing](integration_testing.md) page.
Expand All @@ -50,6 +44,6 @@ 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 $ godep go build .
$GOPATH/src/github.com/google/cadvisor $ make
```

4 changes: 2 additions & 2 deletions docs/development/integration_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
The cAdvisor integration tests can be found in `integration/tests`. These run queries on a running cAdvisor. To run these tests:

```
$ godep go run integration/runner/runner.go -port=PORT <hosts to test>
$ go run integration/runner/runner.go -port=PORT <hosts to test>
```

This will build a cAdvisor from the current repository and start it on the target machine before running the tests.

To simply run the tests against an existing cAdvisor:

```
$ godep go test github.com/google/cadvisor/integration/tests/... -host=HOST -port=PORT
$ go test github.com/google/cadvisor/integration/tests/... -host=HOST -port=PORT
```

Note that `HOST` and `PORT` default to `localhost` and `8080` respectively.
Expand Down
2 changes: 1 addition & 1 deletion integration/runner/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if ! git diff --name-only origin/master | grep -c -E "*.go|*.sh" &> /dev/null; t
fi

# Build the runner.
godep go build github.com/google/cadvisor/integration/runner
go build github.com/google/cadvisor/integration/runner

# Run it.
HOSTS=$@
Expand Down
4 changes: 2 additions & 2 deletions integration/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
)

// must be able to ssh into hosts without password
// godep go run ./integration/runner/runner.go --logtostderr --v 2 --ssh-config <.ssh/config file> <list of hosts>
// go run ./integration/runner/runner.go --logtostderr --v 2 --ssh-config <.ssh/config file> <list of hosts>

const (
cadvisorBinary = "cadvisor"
Expand Down Expand Up @@ -180,7 +180,7 @@ func PushAndRunTests(host, testDir string) (result error) {
}
// Run the command

err = RunCommand("godep", "go", "test", "--timeout", testTimeout.String(), "github.com/google/cadvisor/integration/tests/...", "--host", host, "--port", portStr, "--ssh-options", *sshOptions)
err = RunCommand("go", "test", "--timeout", testTimeout.String(), "github.com/google/cadvisor/integration/tests/...", "--host", host, "--port", portStr, "--ssh-options", *sshOptions)
if err == nil {
// On success, break out of retry loop
break
Expand Down
4 changes: 2 additions & 2 deletions vendor/github.com/abbot/go-http-auth/auth.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vendor/github.com/abbot/go-http-auth/digest.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/abbot/go-http-auth/users.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/kr/text/wrap.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/google.golang.org/grpc/stream.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 38ea12a

Please sign in to comment.