github.com/spg/deis@v1.7.3/store/Makefile (about)

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