mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 01:59:07 +00:00
Add ineffassign to go-compile, use tmp files to ensure proper failure
handling Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
This commit is contained in:
parent
28f3f2c946
commit
31a8480878
10
Makefile
10
Makefile
@ -5,7 +5,7 @@ all: default
|
|||||||
VERSION="0.0" # dummy for now
|
VERSION="0.0" # dummy for now
|
||||||
GIT_COMMIT=$(shell git rev-list -1 HEAD)
|
GIT_COMMIT=$(shell git rev-list -1 HEAD)
|
||||||
|
|
||||||
GO_COMPILE=linuxkit/go-compile:90607983001c2789911afabf420394d51f78ced8@sha256:8b6566c6fd9f3bca31191b919449248d3cb1ca3a562276fca7199e93451d6596
|
GO_COMPILE=linuxkit/go-compile:4513068d9a7e919e4ec42e2d7ee879ff5b95b7f5@sha256:bdfadbe3e4ec699ca45b67453662321ec270f2d1a1dbdbf09625776d3ebd68c5
|
||||||
|
|
||||||
MOBY?=bin/moby
|
MOBY?=bin/moby
|
||||||
GOOS=$(shell uname -s | tr '[:upper:]' '[:lower:]')
|
GOOS=$(shell uname -s | tr '[:upper:]' '[:lower:]')
|
||||||
@ -20,12 +20,16 @@ endif
|
|||||||
MOBY_DEPS=$(wildcard src/cmd/moby/*.go) Makefile vendor.conf
|
MOBY_DEPS=$(wildcard src/cmd/moby/*.go) Makefile vendor.conf
|
||||||
MOBY_DEPS+=$(wildcard src/initrd/*.go) $(wildcard src/pad4/*.go)
|
MOBY_DEPS+=$(wildcard src/initrd/*.go) $(wildcard src/pad4/*.go)
|
||||||
bin/moby: $(MOBY_DEPS) | bin
|
bin/moby: $(MOBY_DEPS) | bin
|
||||||
tar cf - vendor src/initrd src/pad4 -C src/cmd/moby . | docker run --rm --net=none --log-driver=none -i $(CROSS) $(GO_COMPILE) --package github.com/docker/moby --ldflags "-X main.GitCommit=$(GIT_COMMIT) -X main.Version=$(VERSION)" -o $@ | tar xf -
|
tar cf - vendor src/initrd src/pad4 -C src/cmd/moby . | docker run --rm --net=none --log-driver=none -i $(CROSS) $(GO_COMPILE) --package github.com/docker/moby --ldflags "-X main.GitCommit=$(GIT_COMMIT) -X main.Version=$(VERSION)" -o $@ > tmp_moby_bin.tar
|
||||||
|
tar xf tmp_moby_bin.tar > $@
|
||||||
|
rm tmp_moby_bin.tar
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
INFRAKIT_DEPS=$(wildcard src/cmd/infrakit-instance-hyperkit/*.go) Makefile vendor.conf
|
INFRAKIT_DEPS=$(wildcard src/cmd/infrakit-instance-hyperkit/*.go) Makefile vendor.conf
|
||||||
bin/infrakit-instance-hyperkit: $(INFRAKIT_DEPS) | bin
|
bin/infrakit-instance-hyperkit: $(INFRAKIT_DEPS) | bin
|
||||||
tar cf - vendor -C src/cmd/infrakit-instance-hyperkit . | docker run --rm --net=none --log-driver=none -i $(CROSS) $(GO_COMPILE) --package github.com/docker/moby -o $@ | tar xf -
|
tar cf - vendor -C src/cmd/infrakit-instance-hyperkit . | docker run --rm --net=none --log-driver=none -i $(CROSS) $(GO_COMPILE) --package github.com/docker/moby -o $@ > tmp_infrakit_instance_hyperkit_bin.tar
|
||||||
|
tar xf tmp_infrakit_instance_hyperkit_bin.tar > $@
|
||||||
|
rm tmp_infrakit_instance_hyperkit_bin.tar
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
test-initrd.img: $(MOBY) test/test.yml
|
test-initrd.img: $(MOBY) test/test.yml
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
FROM alpine:3.5
|
FROM alpine:3.5
|
||||||
RUN apk update && apk add --no-cache build-base git go
|
RUN apk update && apk add --no-cache build-base git go
|
||||||
ENV GOPATH=/go PATH=$PATH:/go/bin
|
ENV GOPATH=/go PATH=$PATH:/go/bin
|
||||||
RUN go get -u github.com/golang/lint/golint
|
RUN go get -u github.com/golang/lint/golint && \
|
||||||
RUN go get -u github.com/LK4D4/vndr
|
go get -u github.com/gordonklaus/ineffassign && \
|
||||||
|
go get -u github.com/LK4D4/vndr
|
||||||
|
|
||||||
COPY . ./
|
COPY . ./
|
||||||
|
|
||||||
|
@ -61,6 +61,9 @@ test -z $(GOOS=linux go tool vet -printf=false . 2>&1 | grep -v vendor/ | tee /d
|
|||||||
>&2 echo "golint..."
|
>&2 echo "golint..."
|
||||||
test -z $(find . -type f -name "*.go" -not -path "*/vendor/*" -not -name "*.pb.*" -exec golint {} \; | tee /dev/stderr)
|
test -z $(find . -type f -name "*.go" -not -path "*/vendor/*" -not -name "*.pb.*" -exec golint {} \; | tee /dev/stderr)
|
||||||
|
|
||||||
|
>&2 echo "ineffassign..."
|
||||||
|
test -z $(find . -type f -name "*.go" -not -path "*/vendor/*" -not -name "*.pb.*" -exec ineffassign {} \; | tee /dev/stderr)
|
||||||
|
|
||||||
>&2 echo "go build..."
|
>&2 echo "go build..."
|
||||||
|
|
||||||
if [ "$GOOS" = "darwin" ]
|
if [ "$GOOS" = "darwin" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user