add dockerfile/makefile additions for ci

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
This commit is contained in:
Jessica Frazelle 2015-12-18 09:08:14 -08:00
parent 1d63236c27
commit 5b3f41c244
No known key found for this signature in database
GPG key ID: 18F3685C0022BFF3
2 changed files with 73 additions and 9 deletions

View file

@ -1,21 +1,56 @@
BUILDTAGS=libcontainer
all:
# if this session isn't interactive, then we don't want to allocate a
# TTY, which would fail, but if it is interactive, we do want to attach
# so that the user can send e.g. ^C through.
INTERACTIVE := $(shell [ -t 0 ] && echo 1 || echo 0)
ifeq ($(INTERACTIVE), 1)
DOCKER_FLAGS += -t
endif
DOCKER_IMAGE := containerd-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
DOCKER_RUN := docker run --rm -i $(DOCKER_FLAGS) "$(DOCKER_IMAGE)"
all: client daemon
bin:
mkdir -p bin/
cd containerd && go build -tags "$(BUILDTAGS)" -o ../bin/containerd
clean:
rm -rf bin
client: bin
cd ctr && go build -o ../bin/ctr
client:
mkdir -p bin/
cd ctr && go build -o ../bin/ctr
daemon:
mkdir -p bin/
daemon: bin
cd containerd && go build -tags "$(BUILDTAGS)" -o ../bin/containerd
dbuild:
@docker build --rm --force-rm -t "$(DOCKER_IMAGE)" .
dtest: dbuild
$(DOCKER_RUN) make test
install:
cp bin/* /usr/local/bin/
protoc:
protoc -I ./api/grpc/types ./api/grpc/types/api.proto --go_out=plugins=grpc:api/grpc/types
fmt:
@gofmt -s -l . | grep -v vendor | grep -v .pb. | tee /dev/stderr
lint:
@golint ./... | grep -v vendor | grep -v .pb. | tee /dev/stderr
shell:
$(DOCKER_RUN) bash
test: all validate
go test -v $(shell go list ./... | grep -v /vendor)
validate: fmt lint vet
vet:
go vet $(shell go list ./... | grep -v vendor)