@@ -22,6 +22,8 @@ ifndef DEIS_FIRST_ROUTER
2222 DEIS_FIRST_ROUTER = 1
2323endif
2424
25+ DEIS_LAST_ROUTER = $(shell echo $(DEIS_FIRST_ROUTER ) \+$(DEIS_NUM_ROUTERS ) \-1 | bc)
26+
2527# TODO refactor to support non-vagrant installations, since this Makefile
2628# is now used by the various contrib/ scripts.
2729define ssh_all
@@ -51,6 +53,7 @@ START_COMPONENTS=registry logger cache database
5153
5254ALL_UNITS = $(foreach C, $(ALL_COMPONENTS ) , $(wildcard $(C ) /systemd/* ) )
5355START_UNITS = $(foreach C, $(START_COMPONENTS ) , $(wildcard $(C ) /systemd/* ) )
56+ ROUTER_UNITS = $(shell seq -f "deis-router.% g" -s " " $(DEIS_FIRST_ROUTER ) 1 $(DEIS_LAST_ROUTER ) )
5457
5558all : build run
5659
7982
8083restart : stop start
8184
82- routers :
83- $(call echo_yellow,"Starting $(DEIS_NUM_ROUTERS ) router(s) ..." )
84- @router_num=$(DEIS_FIRST_ROUTER ) ; \
85- i=1 ; while [ $$ i -le $( DEIS_NUM_ROUTERS) ] ; do \
86- cp router/systemd/deis-router.service ./deis-router.$$ router_num.service ; \
87- $(FLEETCTL ) submit ./deis-router.$$ router_num.service ; \
88- $(FLEETCTL ) start ./deis-router.$$ router_num.service ; \
89- rm -f ./deis-router.$$ router_num.service ; \
90- i=` expr $$ i + 1` ; \
91- router_num=` expr $$ router_num + 1` ; \
92- done
93-
9485run : install start
9586
96- start : check-fleet routers
87+ start : check-fleet start- routers
9788 @# registry logger cache database
9889 $(call echo_yellow,"Starting Deis! Deis will be functional once all services are reported as running... ")
9990 $(FLEETCTL ) start $(START_UNITS )
@@ -117,6 +108,15 @@ start: check-fleet routers
117108
118109 $(call echo_yellow,"Your Deis cluster is ready to go! Continue following the README to login and use Deis.")
119110
111+ start-routers :
112+ $(call echo_yellow,"Starting $(DEIS_NUM_ROUTERS ) router(s) ..." )
113+ @ $(foreach C, $(ROUTER_UNITS ) , \
114+ cp router/systemd/deis-router.service ./$(C ) .service ; \
115+ fleetctl --strict-host-key-checking=false submit ./$(C ) .service ; \
116+ fleetctl --strict-host-key-checking=false start ./$(C ) .service ; \
117+ rm -f ./$(C ) .service ; \
118+ )
119+
120120status : check-fleet
121121 $(FLEETCTL ) list-units
122122
0 commit comments