build: some minor post-repo-split fixes; add fastbuild
This commit is contained in:
parent
0997c532a1
commit
43a24515ee
@ -19,17 +19,10 @@ env:
|
|||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
|
||||||
install:
|
|
||||||
- |
|
|
||||||
go get github.com/containernetworking/cni || true
|
|
||||||
pushd ../cni
|
|
||||||
GOARCH="${TARGET}" ./build.sh
|
|
||||||
popd
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
if [ "${TARGET}" == "amd64" ]; then
|
if [ "${TARGET}" == "amd64" ]; then
|
||||||
CNI_PATH="$(cd ../cni/bin && pwd)" GOARCH="${TARGET}" ./test.sh
|
GOARCH="${TARGET}" ./test.sh
|
||||||
else
|
else
|
||||||
GOARCH="${TARGET}" ./build.sh
|
GOARCH="${TARGET}" ./build.sh
|
||||||
fi
|
fi
|
||||||
|
7
build.sh
7
build.sh
@ -21,6 +21,11 @@ for d in $PLUGINS; do
|
|||||||
plugin="$(basename "$d")"
|
plugin="$(basename "$d")"
|
||||||
echo " $plugin"
|
echo " $plugin"
|
||||||
# use go install so we don't duplicate work
|
# 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
|
fi
|
||||||
done
|
done
|
||||||
|
@ -186,7 +186,7 @@ func testEchoServer(address string) bool {
|
|||||||
}
|
}
|
||||||
defer conn.Close()
|
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)
|
fmt.Fprintln(GinkgoWriter, "connected to", address)
|
||||||
|
|
||||||
message := "Aliquid melius quam pessimum optimum non est."
|
message := "Aliquid melius quam pessimum optimum non est."
|
||||||
@ -196,7 +196,7 @@ func testEchoServer(address string) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
conn.SetDeadline(time.Now().Add(2 * time.Second))
|
conn.SetDeadline(time.Now().Add(20 * time.Second))
|
||||||
fmt.Fprintln(GinkgoWriter, "reading...")
|
fmt.Fprintln(GinkgoWriter, "reading...")
|
||||||
response := make([]byte, len(message))
|
response := make([]byte, len(message))
|
||||||
_, err = conn.Read(response)
|
_, err = conn.Read(response)
|
||||||
|
11
test.sh
11
test.sh
@ -19,9 +19,7 @@ if [ -z "$PKG" ]; then
|
|||||||
|
|
||||||
# user has provided PKG override
|
# user has provided PKG override
|
||||||
else
|
else
|
||||||
# strip out slashes and dots from PKG=./foo/
|
TEST=$PKG
|
||||||
TEST=${PKG//\//}
|
|
||||||
TEST=${TEST//./}
|
|
||||||
|
|
||||||
# only run gofmt on packages provided by user
|
# only run gofmt on packages provided by user
|
||||||
FMT="$TEST"
|
FMT="$TEST"
|
||||||
@ -40,4 +38,9 @@ if [ -n "${fmtRes}" ]; then
|
|||||||
exit 255
|
exit 255
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Checking govet..."
|
||||||
|
vetRes=$(go vet $TEST)
|
||||||
|
if [ -n "${vetRes}" ]; then
|
||||||
|
echo -e "govet checking failed:\n${vetRes}"
|
||||||
|
exit 255
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user