github.com/technosophos/deis@v1.7.1-0.20150915173815-f9005256004b/logger/Makefile (about) 1 include ../includes.mk 2 3 # the filepath to this repository, relative to $GOPATH/src 4 repo_path = github.com/deis/deis/logger 5 6 GO_FILES = $(wildcard *.go) 7 GO_PACKAGES = syslog syslogd tests 8 GO_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,$(GO_PACKAGES)) 9 GO_TESTABLE_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,syslog syslogd) 10 11 COMPONENT = $(notdir $(repo_path)) 12 IMAGE = $(IMAGE_PREFIX)$(COMPONENT):$(BUILD_TAG) 13 DEV_IMAGE = $(REGISTRY)$(IMAGE) 14 BINARY_DEST_DIR = image/bin 15 16 build: check-docker 17 GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -installsuffix cgo -ldflags '-s' -o $(BINARY_DEST_DIR)/logger github.com/deis/deis/logger || exit 1 18 @$(call check-static-binary,$(BINARY_DEST_DIR)/logger) 19 docker build -t $(IMAGE) image 20 21 clean: check-docker check-registry 22 rm -f image/bin/logger 23 docker rmi $(IMAGE) 24 25 full-clean: check-docker check-registry 26 docker images -q $(IMAGE_PREFIX)$(COMPONENT) | xargs docker rmi -f 27 28 install: check-deisctl 29 deisctl install $(COMPONENT) 30 31 uninstall: check-deisctl 32 deisctl uninstall $(COMPONENT) 33 34 start: check-deisctl 35 deisctl start $(COMPONENT) 36 37 stop: check-deisctl 38 deisctl stop $(COMPONENT) 39 40 restart: stop start 41 42 run: install start 43 44 dev-release: push set-image 45 46 push: check-registry 47 docker tag -f $(IMAGE) $(DEV_IMAGE) 48 docker push $(DEV_IMAGE) 49 50 set-image: check-deisctl 51 deisctl config $(COMPONENT) set image=$(DEV_IMAGE) 52 53 release: 54 docker push $(IMAGE) 55 56 deploy: build dev-release restart 57 58 test: test-style test-unit test-functional 59 60 test-functional: 61 @$(MAKE) -C ../tests/ test-etcd 62 GOPATH=`cd ../tests/ && godep path`:$(GOPATH) go test -v ./tests/... 63 64 test-style: 65 # display output, then check 66 $(GOFMT) $(GO_PACKAGES) $(GO_FILES) 67 @$(GOFMT) $(GO_PACKAGES) $(GO_FILES) | read; if [ $$? == 0 ]; then echo "gofmt check failed."; exit 1; fi 68 $(GOVET) $(repo_path) $(GO_PACKAGES_REPO_PATH) 69 $(GOLINT) ./... 70 71 test-unit: test-style 72 $(GOTEST) $(GO_TESTABLE_PACKAGES_REPO_PATH) 73 74 coverage: 75 go test -coverprofile coverage.out ./syslog 76 go tool cover -html=coverage.out