Skip to content

Commit

Permalink
Merge pull request containernetworking#13 from squeed/build-fixes
Browse files Browse the repository at this point in the history
build: some minor post-repo-split fixes; add fastbuild
  • Loading branch information
Casey Callendrello authored Jun 2, 2017
2 parents 0997c53 + 43a2451 commit e8bea55
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
9 changes: 1 addition & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,10 @@ env:
matrix:
fast_finish: true

install:
- |
go get github.com/containernetworking/cni || true
pushd ../cni
GOARCH="${TARGET}" ./build.sh
popd
script:
- |
if [ "${TARGET}" == "amd64" ]; then
CNI_PATH="$(cd ../cni/bin && pwd)" GOARCH="${TARGET}" ./test.sh
GOARCH="${TARGET}" ./test.sh
else
GOARCH="${TARGET}" ./build.sh
fi
Expand Down
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ for d in $PLUGINS; do
plugin="$(basename "$d")"
echo " $plugin"
# use go install so we don't duplicate work
go build -o "${PWD}/bin/$plugin" -pkgdir "$GOPATH/pkg" "$@" "$REPO_PATH/$d"
if [ -n "$FASTBUILD" ]
then
GOBIN=${PWD}/bin go install -pkgdir $GOPATH/pkg "$@" $REPO_PATH/$d
else
go build -o "${PWD}/bin/$plugin" -pkgdir "$GOPATH/pkg" "$@" "$REPO_PATH/$d"
fi
fi
done
4 changes: 2 additions & 2 deletions plugins/meta/portmap/portmap_integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func testEchoServer(address string) bool {
}
defer conn.Close()

conn.SetDeadline(time.Now().Add(2 * time.Second))
conn.SetDeadline(time.Now().Add(20 * time.Second))
fmt.Fprintln(GinkgoWriter, "connected to", address)

message := "Aliquid melius quam pessimum optimum non est."
Expand All @@ -196,7 +196,7 @@ func testEchoServer(address string) bool {
return false
}

conn.SetDeadline(time.Now().Add(2 * time.Second))
conn.SetDeadline(time.Now().Add(20 * time.Second))
fmt.Fprintln(GinkgoWriter, "reading...")
response := make([]byte, len(message))
_, err = conn.Read(response)
Expand Down
11 changes: 7 additions & 4 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ if [ -z "$PKG" ]; then

# user has provided PKG override
else
# strip out slashes and dots from PKG=./foo/
TEST=${PKG//\//}
TEST=${TEST//./}
TEST=$PKG

# only run gofmt on packages provided by user
FMT="$TEST"
Expand All @@ -40,4 +38,9 @@ if [ -n "${fmtRes}" ]; then
exit 255
fi


echo "Checking govet..."
vetRes=$(go vet $TEST)
if [ -n "${vetRes}" ]; then
echo -e "govet checking failed:\n${vetRes}"
exit 255
fi

0 comments on commit e8bea55

Please sign in to comment.