github.com/epicpaas/deis@v1.0.2-0.20141114233758-6bbccb748f60/router/Makefile (about) 1 include ../includes.mk 2 3 COMPONENT = router 4 IMAGE = $(IMAGE_PREFIX)$(COMPONENT):$(BUILD_TAG) 5 DEV_IMAGE = $(DEV_REGISTRY)/$(IMAGE) 6 BUILD_IMAGE = $(COMPONENT)-build 7 8 build: check-docker 9 docker build -t $(BUILD_IMAGE) parent 10 docker cp `docker run -d $(BUILD_IMAGE)`:/nginx.tgz . 11 docker cp `docker run -d $(BUILD_IMAGE)`:/go/bin/boot bin/ 12 docker build -t $(IMAGE) . 13 rm nginx.tgz 14 rm bin/boot 15 16 clean: check-docker check-registry 17 docker rmi $(IMAGE) 18 19 full-clean: check-docker check-registry 20 docker images -q $(IMAGE_PREFIX)$(COMPONENT) | xargs docker rmi -f 21 22 install: check-deisctl 23 deisctl scale $(COMPONENT)=1 24 25 uninstall: check-deisctl 26 deisctl scale $(COMPONENT)=0 27 28 start: check-deisctl 29 deisctl start $(COMPONENT) 30 31 stop: check-deisctl 32 deisctl stop $(COMPONENT) 33 34 restart: stop start 35 36 run: install start 37 38 dev-release: push set-image 39 40 push: check-registry 41 docker tag $(IMAGE) $(DEV_IMAGE) 42 docker push $(DEV_IMAGE) 43 44 set-image: check-deisctl 45 deisctl config $(COMPONENT) set image=$(DEV_IMAGE) 46 47 release: 48 docker push $(IMAGE) 49 50 deploy: build dev-release restart 51 52 test: test-unit test-functional 53 54 test-unit: 55 @echo no unit tests 56 57 test-functional: 58 @docker history deis/test-etcd >/dev/null 2>&1 || docker pull deis/test-etcd:latest 59 GOPATH=$(CURDIR)/../tests/_vendor:$(GOPATH) go test -v ./tests/...