github.com/misfo/deis@v1.0.1-0.20141111224634-e0eee0392b8a/store/Makefile (about)

     1  include ../includes.mk
     2  
     3  TEMPLATE_IMAGES=daemon gateway metadata monitor
     4  BUILT_IMAGES=base $(TEMPLATE_IMAGES)
     5  
     6  DAEMON_IMAGE = $(IMAGE_PREFIX)store-daemon:$(BUILD_TAG)
     7  DAEMON_DEV_IMAGE = $(DEV_REGISTRY)/$(DAEMON_IMAGE)
     8  GATEWAY_IMAGE = $(IMAGE_PREFIX)store-gateway:$(BUILD_TAG)
     9  GATEWAY_DEV_IMAGE = $(DEV_REGISTRY)/$(GATEWAY_IMAGE)
    10  METADATA_IMAGE = $(IMAGE_PREFIX)store-metadata:$(BUILD_TAG)
    11  METADATA_DEV_IMAGE = $(DEV_REGISTRY)/$(METADATA_IMAGE)
    12  MONITOR_IMAGE = $(IMAGE_PREFIX)store-monitor:$(BUILD_TAG)
    13  MONITOR_DEV_IMAGE = $(DEV_REGISTRY)/$(MONITOR_IMAGE)
    14  
    15  build: check-docker
    16  	@# Build base as normal
    17  	docker build -t deis/store-base:$(BUILD_TAG) base/
    18  	$(foreach I, $(TEMPLATE_IMAGES), \
    19  		sed -e "s/#FROM is generated dynamically by the Makefile/FROM deis\/store-base:${BUILD_TAG}/" $(I)/Dockerfile.template > $(I)/Dockerfile ; \
    20  		docker build -t deis/store-$(I):$(BUILD_TAG) $(I)/ ; \
    21  		rm $(I)/Dockerfile ; \
    22  	)
    23  
    24  push: check-docker check-registry check-deisctl
    25  	$(foreach I, $(BUILT_IMAGES), \
    26  		docker tag deis/store-$(I):$(BUILD_TAG) $(REGISTRY)/deis/store-$(I):$(BUILD_TAG) ; \
    27  		docker push $(REGISTRY)/deis/store-$(I):$(BUILD_TAG) ; \
    28  	)
    29  
    30  	$(foreach I, $(TEMPLATE_IMAGES), \
    31  		deisctl config store-$(I) set image=$(REGISTRY)/deis/store-$(I):$(BUILD_TAG) ; \
    32  	)
    33  
    34  clean: check-docker check-registry
    35  	$(foreach I, $(BUILT_IMAGES), \
    36  		docker rmi deis/store-$(I):$(BUILD_TAG) ; \
    37  		docker rmi $(REGISTRY)/deis/store-$(I):$(BUILD_TAG) ; \
    38  	)
    39  
    40  full-clean: check-docker check-registry
    41  	$(foreach I, $(BUILT_IMAGES), \
    42  		docker images -q deis/store-$(I) | xargs docker rmi -f ; \
    43  		docker images -q $(REGISTRY)/deis/store-$(I) | xargs docker rmi -f ; \
    44  	)
    45  
    46  install: check-deisctl
    47  	deisctl install store-monitor
    48  	deisctl install store-daemon
    49  	deisctl install store-metadata
    50  	deisctl install store-volume
    51  	deisctl install store-gateway
    52  
    53  uninstall: check-deisctl
    54  	deisctl uninstall store-gateway
    55  	deisctl uninstall store-volume
    56  	deisctl uninstall store-metadata
    57  	deisctl uninstall store-daemon
    58  	deisctl uninstall store-monitor
    59  
    60  start: check-deisctl
    61  	deisctl start store-monitor
    62  	deisctl start store-daemon
    63  	deisctl start store-metadata
    64  	deisctl start store-volume
    65  	deisctl start store-gateway
    66  
    67  stop: check-deisctl
    68  	deisctl stop store-gateway
    69  	deisctl stop store-volume
    70  	deisctl stop store-metadata
    71  	deisctl stop store-daemon
    72  	deisctl stop store-monitor
    73  
    74  restart: stop start
    75  
    76  run: install start
    77  
    78  dev-release: push set-image
    79  
    80  push: check-registry
    81  	docker tag $(DAEMON_IMAGE) $(DAEMON_DEV_IMAGE)
    82  	docker push $(DAEMON_DEV_IMAGE)
    83  	docker tag $(GATEWAY_IMAGE) $(GATEWAY_DEV_IMAGE)
    84  	docker push $(GATEWAY_DEV_IMAGE)
    85  	docker tag $(METADATA_IMAGE) $(METADATA_DEV_IMAGE)
    86  	docker push $(METADATA_DEV_IMAGE)
    87  	docker tag $(MONITOR_IMAGE) $(MONITOR_DEV_IMAGE)
    88  	docker push $(MONITOR_DEV_IMAGE)
    89  
    90  set-image: check-deisctl
    91  	deisctl config store-daemon set image=$(DAEMON_DEV_IMAGE)
    92  	deisctl config store-gateway set image=$(GATEWAY_DEV_IMAGE)
    93  	deisctl config store-metadata set image=$(METADATA_DEV_IMAGE)
    94  	deisctl config store-monitor set image=$(MONITOR_DEV_IMAGE)
    95  
    96  release:
    97  	docker push $(DAEMON_IMAGE)
    98  	docker push $(GATEWAY_IMAGE)
    99  	docker push $(METADATA_IMAGE)
   100  	docker push $(MONITOR_IMAGE)
   101  
   102  deploy: build dev-release restart
   103  
   104  test: test-unit test-functional
   105  
   106  test-unit:
   107  	@echo no unit tests
   108  
   109  test-functional:
   110  	@docker history deis/test-etcd >/dev/null 2>&1 || docker pull deis/test-etcd:latest
   111  	GOPATH=$(CURDIR)/../tests/_vendor:$(GOPATH) go test -v ./tests/...