From 533a843393bd7c3674074ec9af73c8e666fc7484 Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Mon, 22 May 2017 15:11:53 -0700 Subject: [PATCH] Move the hashing of files to its own target So we can use it at will Signed-off-by: Eli Uriegas --- static/Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/static/Makefile b/static/Makefile index b4be5efd808..1c8d25d952e 100644 --- a/static/Makefile +++ b/static/Makefile @@ -5,8 +5,9 @@ ENGINE_VER=$(shell cat $(ENGINE_DIR)/VERSION) VERSION=$(shell cat $(ENGINE_DIR)/VERSION) CHOWN=docker run --rm -v $(CURDIR):/v -w /v alpine chown HASH_CMD=docker run -v $(CURDIR):/sum -it -w /sum debian:jessie bash hash_files +DIR_TO_HASH:=build/linux -.PHONY: help clean static static-linux cross-mac cross-win cross-arm static-cli static-engine cross-all-cli cross-win-engine +.PHONY: help clean static static-linux cross-mac cross-win cross-arm static-cli static-engine cross-all-cli cross-win-engine hash_files help: ## show make targets @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) @@ -24,13 +25,15 @@ static-linux: static-cli static-engine ## create tgz with linux x86_64 client an cp $(ENGINE_DIR)/bundles/$(ENGINE_VER)/binary-daemon/$$f build/linux/docker; \ done tar -C build/linux -c -z -f build/linux/docker-$(VERSION).tgz docker - $(HASH_CMD) build/linux + +hash_files: + @echo "Hashing directory $(DIR_TO_HASH)" + $(HASH_CMD) "$(DIR_TO_HASH)" cross-mac: cross-all-cli ## create tgz with darwin x86_64 client only mkdir -p build/mac/docker cp $(CLI_DIR)/build/docker-darwin-amd64 build/mac/docker/docker tar -C build/mac -c -z -f build/mac/docker-$(VERSION).tgz docker - $(HASH_CMD) build/mac cross-win: cross-all-cli cross-win-engine ## create zip file with windows x86_64 client and server mkdir -p build/win/docker @@ -38,13 +41,11 @@ cross-win: cross-all-cli cross-win-engine ## create zip file with windows x86_64 cp $(ENGINE_DIR)/bundles/$(ENGINE_VER)/cross/windows/amd64/dockerd-$(ENGINE_VER).exe build/win/docker/dockerd.exe docker run --rm -v $(CURDIR)/build/win:/v -w /v alpine sh -c 'apk update&&apk add zip&&zip -r docker-$(VERSION).zip docker' $(CHOWN) -R $(shell id -u):$(shell id -g) build - $(HASH_CMD) bash hash_files build/win cross-arm: cross-all-cli ## create tgz with linux armhf client only mkdir -p build/arm/docker cp $(CLI_DIR)/build/docker-linux-arm build/arm/docker/docker tar -C build/arm -c -z -f build/arm/docker-$(VERSION).tgz docker - $(HASH_CMD) build/arm static-cli: $(MAKE) -C $(CLI_DIR) -f docker.Makefile VERSION=$(VERSION) build