github.com/technosophos/deis@v1.7.1-0.20150915173815-f9005256004b/logspout/Makefile (about) 1 include ../includes.mk 2 3 # the filepath to this repository, relative to $GOPATH/src 4 repo_path = github.com/deis/deis/logspout 5 6 GO_FILES = $(wildcard *.go) 7 GO_PACKAGES = utils 8 GO_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,$(GO_PACKAGES)) 9 10 COMPONENT = $(notdir $(repo_path)) 11 DOCKER_IMAGE := $(IMAGE_PREFIX)$(COMPONENT) 12 RELEASE_IMAGE := $(DOCKER_IMAGE):$(BUILD_TAG) 13 DEV_DOCKER_IMAGE := $(REGISTRY)$(RELEASE_IMAGE) 14 15 build: check-docker 16 GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -installsuffix cgo -ldflags '-s' -o image/logspout 17 @$(call check-static-binary,image/logspout) 18 docker build -t $(RELEASE_IMAGE) image 19 20 clean: 21 rm -rf image/logspout 22 23 full-clean: 24 docker images -q $(DOCKER_IMAGE) | xargs docker rmi -f 25 docker images -q $(DEV_DOCKER_IMAGE) | xargs docker rmi -f 26 docker images -q $(RELEASE_IMAGE) | 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 $(RELEASE_IMAGE) $(DEV_DOCKER_IMAGE) 48 docker push $(DEV_DOCKER_IMAGE) 49 50 set-image: check-deisctl 51 deisctl config $(COMPONENT) set image=$(DEV_DOCKER_IMAGE) 52 53 release: 54 docker push $(RELEASE_IMAGE) 55 56 deploy: build dev-release restart 57 58 test: test-style test-unit test-functional 59 60 test-functional: 61 @echo no functional tests 62 63 test-style: 64 # display output, then check 65 $(GOFMT) $(GO_PACKAGES) $(GO_FILES) 66 @$(GOFMT) $(GO_PACKAGES) $(GO_FILES) | read; if [ $$? == 0 ]; then echo "gofmt check failed."; exit 1; fi 67 $(GOVET) $(repo_path) $(GO_PACKAGES_REPO_PATH) 68 $(GOLINT) ./... 69 70 test-unit: 71 @echo no unit tests