github.com/wasbazi/deis@v1.7.1-0.20150609203025-5765871615de/Makefile (about) 1 # 2 # Deis Makefile 3 # 4 5 include includes.mk 6 7 # the filepath to this repository, relative to $GOPATH/src 8 repo_path = github.com/deis/deis 9 10 GO_PACKAGES = pkg/time version 11 GO_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,$(GO_PACKAGES)) 12 13 COMPONENTS=builder cache controller database logger logspout publisher registry router store swarm 14 START_ORDER=publisher store logger logspout database cache registry controller builder router 15 CLIENTS=client deisctl 16 17 all: build run 18 19 dev-registry: check-docker 20 @docker inspect registry >/dev/null 2>&1 && docker start registry || docker run --restart="always" -d -p 5000:5000 --name registry registry:0.9.1 21 @echo 22 @echo "To use local boot2docker registry for Deis development:" 23 @echo " export DEV_REGISTRY=`boot2docker ip 2>/dev/null`:5000" 24 25 dev-cluster: discovery-url 26 vagrant up 27 ssh-add ~/.vagrant.d/insecure_private_key 28 deisctl config platform set sshPrivateKey=$(HOME)/.vagrant.d/insecure_private_key 29 deisctl config platform set domain=local3.deisapp.com 30 deisctl install platform 31 32 discovery-url: 33 sed -e "s,# discovery:,discovery:," -e "s,discovery: https://discovery.etcd.io/.*,discovery: $$(curl -s -w '\n' https://discovery.etcd.io/new)," contrib/coreos/user-data.example > contrib/coreos/user-data 34 35 build: check-docker 36 @$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) build &&) echo done 37 @$(foreach C, $(CLIENTS), $(MAKE) -C $(C) build &&) echo done 38 39 clean: 40 @$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) clean &&) echo done 41 @$(foreach C, $(CLIENTS), $(MAKE) -C $(C) clean &&) echo done 42 43 full-clean: 44 @$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) full-clean &&) echo done 45 46 install: 47 @$(foreach C, $(START_ORDER), $(MAKE) -C $(C) install &&) echo done 48 49 uninstall: 50 @$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) uninstall &&) echo done 51 52 start: 53 @$(foreach C, $(START_ORDER), $(MAKE) -C $(C) start &&) echo done 54 55 stop: 56 @$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) stop &&) echo done 57 58 restart: stop start 59 60 run: install start 61 62 dev-release: 63 @$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) dev-release &&) echo done 64 65 push: 66 @$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) push &&) echo done 67 68 set-image: 69 @$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) set-image &&) echo done 70 71 release: check-registry 72 @$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) release &&) echo done 73 74 deploy: build dev-release restart 75 76 test: test-style test-unit test-functional push test-integration 77 78 test-functional: 79 @$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) test-functional &&) echo done 80 81 test-unit: 82 @$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) test-unit &&) echo done 83 @$(foreach C, $(CLIENTS), $(MAKE) -C $(C) test-unit &&) echo done 84 85 test-integration: 86 $(MAKE) -C tests/ test-full 87 88 test-smoke: 89 $(MAKE) -C tests/ test-smoke 90 91 test-style: 92 # display output, then check 93 $(GOFMT) $(GO_PACKAGES) 94 @$(GOFMT) $(GO_PACKAGES) | read; if [ $$? == 0 ]; then echo "gofmt check failed."; exit 1; fi 95 $(GOVET) $(GO_PACKAGES_REPO_PATH) 96 @for i in $(addsuffix /...,$(GO_PACKAGES)); do \ 97 $(GOLINT) $$i; \ 98 done 99 @$(foreach C, tests $(CLIENTS) $(COMPONENTS), $(MAKE) -C $(C) test-style &&) echo done