diff --git a/.travis.yml b/.travis.yml index 97dd1c7c..136ddcc1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,4 @@ before_script: - sudo service influxdb start script: - export PATH=$PATH:$HOME/gopath/bin - - ./deploy/check_gofmt.sh . - - ./hooks/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 + - ./build/presubmit.sh diff --git a/hooks/boilerplate.go.txt b/build/boilerplate.go.txt similarity index 100% rename from hooks/boilerplate.go.txt rename to build/boilerplate.go.txt diff --git a/hooks/check_boilerplate.sh b/build/check_boilerplate.sh similarity index 96% rename from hooks/check_boilerplate.sh rename to build/check_boilerplate.sh index fb7e59f7..4653c283 100755 --- a/hooks/check_boilerplate.sh +++ b/build/check_boilerplate.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -REF_FILE="./hooks/boilerplate.go.txt" +REF_FILE="./build/boilerplate.go.txt" if [ ! -e $REF_FILE ]; then echo "Missing reference file: " ${REF_FILE} exit 1 diff --git a/hooks/check_errorf.sh b/build/check_errorf.sh similarity index 100% rename from hooks/check_errorf.sh rename to build/check_errorf.sh diff --git a/deploy/check_gofmt.sh b/build/check_gofmt.sh similarity index 100% rename from deploy/check_gofmt.sh rename to build/check_gofmt.sh diff --git a/build/presubmit.sh b/build/presubmit.sh new file mode 100755 index 00000000..d3b5eb25 --- /dev/null +++ b/build/presubmit.sh @@ -0,0 +1,24 @@ +#!/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 +go vet github.com/google/cadvisor/... +godep go test -v -race -test.short github.com/google/cadvisor/... +godep go build github.com/google/cadvisor