github.com/rvaralda/deis@v1.4.1/router/Makefile (about) 1 include ../includes.mk 2 3 # the filepath to this repository, relative to $GOPATH/src 4 repo_path = github.com/deis/deis/router 5 6 GO_FILES = boot.go 7 GO_PACKAGES = logger tests 8 GO_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,$(GO_PACKAGES)) 9 10 COMPONENT = $(notdir $(repo_path)) 11 IMAGE = $(IMAGE_PREFIX)$(COMPONENT):$(BUILD_TAG) 12 DEV_IMAGE = $(DEV_REGISTRY)/$(IMAGE) 13 BUILD_IMAGE = $(COMPONENT)-build 14 15 build: check-docker 16 cp -pR ../Godeps . 17 docker build -t $(BUILD_IMAGE) . 18 docker cp `docker run -d $(BUILD_IMAGE)`:/nginx.tgz image/ 19 docker cp `docker run -d $(BUILD_IMAGE)`:/go/bin/boot image/bin/ 20 docker build -t $(IMAGE) image 21 rm image/nginx.tgz 22 rm image/bin/boot 23 24 clean: check-docker check-registry 25 rm -rf Godeps 26 docker rmi $(IMAGE) 27 28 full-clean: check-docker check-registry 29 docker images -q $(IMAGE_PREFIX)$(COMPONENT) | xargs docker rmi -f 30 31 install: check-deisctl 32 deisctl scale $(COMPONENT)=3 33 34 uninstall: check-deisctl 35 deisctl scale $(COMPONENT)=0 36 37 start: check-deisctl 38 deisctl start $(COMPONENT)@* 39 40 stop: check-deisctl 41 deisctl stop $(COMPONENT)@* 42 43 restart: stop start 44 45 run: install start 46 47 dev-release: push set-image 48 49 push: check-registry 50 docker tag -f $(IMAGE) $(DEV_IMAGE) 51 docker push $(DEV_IMAGE) 52 53 set-image: check-deisctl 54 deisctl config $(COMPONENT) set image=$(DEV_IMAGE) 55 56 release: 57 docker push $(IMAGE) 58 59 deploy: build dev-release restart 60 61 test: test-style test-unit test-functional 62 63 test-functional: 64 @docker history deis/test-etcd >/dev/null 2>&1 || docker pull deis/test-etcd:latest 65 GOPATH=`cd ../tests/ && godep path`:$(GOPATH) go test -v ./tests/... 66 67 test-style: 68 # display output, then check 69 $(GOFMT) $(GO_PACKAGES) $(GO_FILES) 70 @$(GOFMT) $(GO_PACKAGES) $(GO_FILES) | read; if [ $$? == 0 ]; then echo "gofmt check failed."; exit 1; fi 71 $(GOVET) $(repo_path) $(GO_PACKAGES_REPO_PATH) 72 $(GOLINT) ./... 73 74 test-unit: 75 @echo no unit tests