Skip to content

Commit

Permalink
Merge pull request #2102 from dnephin/fix-vendor-validation
Browse files Browse the repository at this point in the history
[release/1.0] Fix vendor validation
  • Loading branch information
stevvooe committed Feb 5, 2018
2 parents 04c223f + b9640ad commit 7193749
Show file tree
Hide file tree
Showing 12 changed files with 284 additions and 106 deletions.
4 changes: 3 additions & 1 deletion .appveyor.yml
Expand Up @@ -23,7 +23,9 @@ before_build:
- choco install codecov

build_script:
- bash.exe -elc "export PATH=/c/tools/mingw64/bin:/c/gopath/bin:$PATH ; mingw32-make.exe setup check"
- bash.exe -elc "export PATH=/c/tools/mingw64/bin:/c/gopath/bin:$PATH;
script/setup/install-dev-tools;
mingw32-make.exe check"
- bash.exe -elc "export PATH=/c/tools/mingw64/bin:$PATH ; mingw32-make.exe build binaries"

test_script:
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -52,7 +52,8 @@ script:
- export GOOS=$TRAVIS_GOOS
- export CGO_ENABLED=$TRAVIS_CGO_ENABLED
- GIT_CHECK_EXCLUDE="./vendor" TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make dco
- GOOS=linux make setup
- GOOS=linux script/setup/install-dev-tools
- script/validate/vendor
- go build -i .
- make check
- if [ "$GOOS" = "linux" ]; then make check-protos check-api-descriptors; fi
Expand Down
9 changes: 1 addition & 8 deletions Makefile
Expand Up @@ -56,7 +56,7 @@ include Makefile.$(target_os)
TESTFLAGS ?= -v $(TESTFLAGS_RACE)
TESTFLAGS_PARALLEL ?= 8

.PHONY: clean all AUTHORS fmt vet lint dco build binaries test integration setup generate protos checkprotos coverage ci check help install uninstall vendor release
.PHONY: clean all AUTHORS fmt vet lint dco build binaries test integration generate protos checkprotos coverage ci check help install uninstall vendor release
.DEFAULT: default

all: binaries
Expand All @@ -70,13 +70,6 @@ ci: check binaries checkprotos coverage coverage-integration ## to be used by th
AUTHORS: .mailmap .git/HEAD
git log --format='%aN <%aE>' | sort -fu > $@

setup: ## install dependencies
@echo "$(WHALE) $@"
# TODO(stevvooe): Install these from the vendor directory
@go get -u github.com/alecthomas/gometalinter
@gometalinter --install > /dev/null
@go get -u github.com/stevvooe/protobuild

generate: protos
@echo "$(WHALE) $@"
@PATH=${ROOTDIR}/bin:${PATH} go generate -x ${PACKAGES}
Expand Down
10 changes: 10 additions & 0 deletions script/setup/install-dev-tools
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
#
# Install developer tools to $GOBIN (or $GOPATH/bin if unset)
#
set -eu -o pipefail

go get -u github.com/stevvooe/protobuild
go get -u github.com/alecthomas/gometalinter
gometalinter --install >/dev/null
go get -u github.com/LK4D4/vndr
19 changes: 19 additions & 0 deletions script/validate/vendor
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -eu -o pipefail

rm -rf vendor/
vndr |& grep -v -i clone

DIFF_PATH="vendor/"
DIFF=$(git status --porcelain -- "$DIFF_PATH")

if [ "$DIFF" ]; then
echo
echo "These files were modified:"
echo
echo "$DIFF"
echo
exit 1
else
echo "$DIFF_PATH is correct"
fi
1 change: 0 additions & 1 deletion vendor.conf
Expand Up @@ -36,7 +36,6 @@ github.com/BurntSushi/toml a368813c5e648fee92e5f6c30e3944ff9d5e8895
github.com/grpc-ecosystem/go-grpc-prometheus 6b7015e65d366bf3f19b2b2a000a831940f0f7e0
github.com/Microsoft/go-winio v0.4.4
github.com/Microsoft/hcsshim v0.6.7
github.com/Microsoft/opengcs v0.3.2
github.com/boltdb/bolt e9cf4fae01b5a8ff89d0ec6b32f0d9c9f79aefdd
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4
Expand Down
18 changes: 8 additions & 10 deletions vendor/github.com/BurntSushi/toml/README.md

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/BurntSushi/toml/doc.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/BurntSushi/toml/encode.go

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

0 comments on commit 7193749

Please sign in to comment.