Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Move the hashing of files to its own target
Browse files Browse the repository at this point in the history
So we can use it at will

Signed-off-by: Eli Uriegas <[email protected]>
  • Loading branch information
seemethere committed May 22, 2017
1 parent a1b7f6f commit 533a843
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions static/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -24,27 +25,27 @@ 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
cp $(CLI_DIR)/build/docker-windows-amd64 build/win/docker/docker.exe
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
Expand Down

0 comments on commit 533a843

Please sign in to comment.