1
0
mirror of https://github.com/rancher/types.git synced 2025-05-05 13:46:18 +00:00

Update build scripts

This commit is contained in:
Darren Shepherd 2017-11-10 22:21:55 -07:00
parent bef3d21dd7
commit 94e948c27d
5 changed files with 11 additions and 27 deletions

View File

@ -12,7 +12,9 @@ ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${ARC
GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash
RUN wget -O - https://storage.googleapis.com/golang/go1.8.3.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \
go get github.com/rancher/trash && go get github.com/golang/lint/golint
go get github.com/rancher/trash && \
go get github.com/golang/lint/golint && \
go get golang.org/x/tools/cmd/goimports
ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
DOCKER_URL_arm=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm \

View File

@ -6,4 +6,3 @@ cd $(dirname $0)
./build
./test
./validate
./package

View File

@ -1,24 +0,0 @@
#!/bin/bash
set -e
source $(dirname $0)/version
ARCH=${ARCH:-"amd64"}
SUFFIX=""
[ "${ARCH}" != "amd64" ] && SUFFIX="_${ARCH}"
cd $(dirname $0)/../package
TAG=${TAG:-${VERSION}${SUFFIX}}
REPO=${REPO:-rancher}
if echo $TAG | grep -q dirty; then
TAG=dev
fi
cp ../bin/types .
IMAGE=${REPO}/types:${TAG}
docker build -t ${IMAGE} .
echo ${IMAGE} > ../dist/images
echo Built ${IMAGE}

View File

@ -9,3 +9,10 @@ PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u
[ "${ARCH}" == "amd64" ] && RACE=-race
go test ${RACE} -cover -tags=test ${PACKAGES}
go generate
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
git status
echo git out of sync with generated code
exit 1
fi

View File

@ -11,7 +11,7 @@ echo Running: go vet
go vet ${PACKAGES}
echo Running: golint
for i in ${PACKAGES}; do
if [ -n "$(golint $i | grep -v 'should have comment.*or be unexported' | tee /dev/stderr)" ]; then
if [ -n "$(golint $i | grep -v zz_generated | grep -v 'should have comment.*or be unexported' | tee /dev/stderr)" ]; then
failed=true
fi
done