github.com/sbuss/deis@v1.6.1/publisher/Makefile (about)

     1  include ../includes.mk
     2  
     3  # the filepath to this repository, relative to $GOPATH/src
     4  repo_path = github.com/deis/deis/publisher
     5  
     6  GO_FILES = main.go
     7  GO_PACKAGES = server
     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  REMOTE_IMAGE := $(REGISTRY)/$(RELEASE_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)/publisher github.com/deis/deis/publisher || exit 1
    18  	$(call check-static-binary,$(BINARY_DEST_DIR)/publisher)
    19  	docker build -t $(RELEASE_IMAGE) image
    20  
    21  clean: check-docker check-registry
    22  	rm -rf $(BINARY_DEST_DIR)
    23  	docker rmi $(RELEASE_IMAGE) $(REMOTE_IMAGE)
    24  
    25  full-clean: check-docker check-registry
    26  	docker images -q $(DOCKER_IMAGE) | xargs docker rmi -f
    27  	docker images -q $(REGISTRY)/$(DOCKER_IMAGE) | xargs docker rmi -f
    28  
    29  install: check-deisctl
    30  	deisctl install publisher
    31  
    32  dev-release: push set-image
    33  
    34  push: check-registry
    35  	docker tag -f $(RELEASE_IMAGE) $(REMOTE_IMAGE)
    36  	docker push $(REMOTE_IMAGE)
    37  
    38  set-image: check-deisctl
    39  	deisctl config publisher set image=$(REMOTE_IMAGE)
    40  
    41  release: check-docker
    42  	docker push $(DOCKER_IMAGE)
    43  
    44  deploy: build dev-release restart
    45  
    46  restart: stop start
    47  
    48  run: install start
    49  
    50  start: check-deisctl
    51  	deisctl start publisher
    52  
    53  stop: check-deisctl
    54  	deisctl stop publisher
    55  
    56  test: test-style test-unit test-functional
    57  
    58  test-functional:
    59  	@echo no functional tests
    60  
    61  test-style:
    62  # display output, then check
    63  	$(GOFMT) $(GO_PACKAGES) $(GO_FILES)
    64  	@$(GOFMT) $(GO_PACKAGES) $(GO_FILES) | read; if [ $$? == 0 ]; then echo "gofmt check failed."; exit 1; fi
    65  	$(GOVET) $(repo_path) $(GO_PACKAGES_REPO_PATH)
    66  	$(GOLINT) ./...
    67  
    68  test-unit:
    69  	godep go test -v ./...
    70  
    71  uninstall: check-deisctl
    72  	deisctl uninstall publisher