github.com/skippbox/kompose-origin@v0.0.0-20160524133224-16a9dca7bac2/Makefile (about)

     1  .PHONY: all test validate-dco validate-gofmt validate build
     2  
     3  LIBCOMPOSE_ENVS := \
     4  	-e OS_PLATFORM_ARG \
     5  	-e OS_ARCH_ARG \
     6  	-e DOCKER_TEST_HOST \
     7  	-e TESTDIRS \
     8  	-e TESTFLAGS \
     9  	-e TESTVERBOSE
    10  
    11  # (default to no bind mount if DOCKER_HOST is set)
    12  BIND_DIR := $(if $(DOCKER_HOST),,bundles)
    13  LIBCOMPOSE_MOUNT := $(if $(BIND_DIR),-v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/docker/libcompose/$(BIND_DIR)")
    14  
    15  GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
    16  LIBCOMPOSE_IMAGE := libcompose-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
    17  
    18  DAEMON_VERSION := $(if $(DAEMON_VERSION),$(DAEMON_VERSION),"default")
    19  TTY := $(shell [ -t 0 ] && echo "-t")
    20  DOCKER_RUN_LIBCOMPOSE := docker run --rm -i $(TTY) --privileged -e DAEMON_VERSION="$(DAEMON_VERSION)" $(LIBCOMPOSE_ENVS) $(LIBCOMPOSE_MOUNT) "$(LIBCOMPOSE_IMAGE)"
    21  
    22  default: binary
    23  
    24  all: build ## validate all checks, build linux binary, run all tests\ncross build non-linux binaries
    25  	$(DOCKER_RUN_LIBCOMPOSE) ./script/make.sh
    26  
    27  binary: build ## build the linux binary
    28  	$(DOCKER_RUN_LIBCOMPOSE) ./script/make.sh binary
    29  
    30  cross-binary: build ## cross build the non linux binaries (windows, darwin)
    31  	$(DOCKER_RUN_LIBCOMPOSE) ./script/make.sh cross-binary
    32  
    33  test: build ## run the unit, integration and acceptance tests
    34  	$(DOCKER_RUN_LIBCOMPOSE) ./script/make.sh binary test-unit test-integration test-acceptance
    35  
    36  test-unit: build ## run the unit tests
    37  	$(DOCKER_RUN_LIBCOMPOSE) ./script/make.sh test-unit
    38  
    39  test-integration: build ## run the integration tests
    40  	$(DOCKER_RUN_LIBCOMPOSE) ./script/make.sh binary test-integration
    41  
    42  test-acceptance: build ## run the acceptance tests
    43  	$(DOCKER_RUN_LIBCOMPOSE) ./script/make.sh binary test-acceptance
    44  
    45  validate: build ## validate DCO, git conflicts marks, gofmt, golint and go vet
    46  	$(DOCKER_RUN_LIBCOMPOSE) ./script/make.sh validate-dco validate-git-marks validate-gofmt validate-lint validate-vet
    47  
    48  shell: build ## start a shell inside the build env
    49  	$(DOCKER_RUN_LIBCOMPOSE) bash
    50  
    51  # Build the docker image, should be prior almost any other goals
    52  build: bundles
    53  	docker build -t "$(LIBCOMPOSE_IMAGE)" .
    54  
    55  bundles:
    56  	mkdir bundles
    57  
    58  clean: 
    59  	$(DOCKER_RUN_LIBCOMPOSE) ./script/make.sh clean
    60  
    61  help: ## this help
    62  	@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)