feat(Makefile): compress binary with upx if available

This commit is contained in:
Matt Boersma 2017-02-09 12:21:27 -07:00
Родитель 548c9980e5
Коммит b694c359ac
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -63,10 +63,19 @@ docker-binary:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -o $(BINDIR)/prowd $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' github.com/deis/prow/cmd/prowd
.PHONY: docker-build
docker-build: check-docker docker-binary
docker-build: check-docker docker-binary compress-binary
docker build --rm -t ${IMAGE} .
docker tag ${IMAGE} ${MUTABLE_IMAGE}
.PHONY: compress-binary
compress-binary: BINDIR = ./rootfs/bin
compress-binary:
@if [ -z $$(which upx) ]; then \
echo "Missing \`upx\` tool to compress binaries"; \
else \
upx --quiet ${BINDIR}/prowd; \
fi
.PHONY: test
test: build
test: TESTFLAGS += -race -v