Skip to content

Commit 56446a0

Browse files
committed
Merge pull request #807 from deis/fix_fleetctl_scheduling
fix(Makefile): upload fleetctl units all at once
2 parents 71a86d9 + 828a1df commit 56446a0

3 files changed

Lines changed: 21 additions & 19 deletions

File tree

Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ else
2121
COMPONENTS=builder cache controller database logger registry
2222
endif
2323

24+
UNIT_FILES = $(foreach C, $(COMPONENTS), $(wildcard $(C)/systemd/*))
25+
2426
all: build run
2527

2628
pull:
@@ -30,17 +32,17 @@ build:
3032
$(call ssh_all,'cd share && for c in $(COMPONENTS); do cd $$c && docker build -t deis/$$c . && cd ..; done')
3133

3234
install:
33-
for c in $(COMPONENTS); do fleetctl --strict-host-key-checking=false submit $$c/systemd/*; done
35+
fleetctl --strict-host-key-checking=false submit $(UNIT_FILES)
3436

35-
uninstall: stop
36-
for c in $(COMPONENTS); do fleetctl --strict-host-key-checking=false destroy $$c/systemd/*; done
37+
uninstall: stop
38+
fleetctl --strict-host-key-checking=false destroy $(UNIT_FILES)
3739

3840
start:
3941
echo "\033[0;33mStarting services can take some time... grab some coffee!\033[0m"
40-
for c in $(COMPONENTS); do fleetctl --strict-host-key-checking=false start $$c/systemd/*; done
42+
fleetctl --strict-host-key-checking=false start $(UNIT_FILES)
4143

4244
stop:
43-
for c in $(COMPONENTS); do fleetctl --strict-host-key-checking=false stop $$c/systemd/*; done
45+
fleetctl --strict-host-key-checking=false stop $(UNIT_FILES)
4446

4547
restart: stop start
4648

contrib/ec2/initialize-ec2-cluster.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ fi
2727

2828
cd $ROOT_DIR
2929

30-
# upload each component's systemd unit to the fleet cluster
31-
for component in registry logger database cache controller builder router
32-
do
33-
pushd $component/systemd > /dev/null
34-
fleetctl submit deis-$component.service
35-
fleetctl start deis-$component.service
36-
popd > /dev/null
30+
# upload all systemd unit to the fleet cluster
31+
units=()
32+
for component in builder cache controller database logger registry router; do
33+
units+=($component/systemd/*)
3734
done
3835

36+
fleetctl submit ${units[@]}
37+
fleetctl start ${units[@]}
38+
3939
echo_green "Done! Inspect the state of the services with: fleetctl list-units"
4040
echo_green "Once all the services are running, you can register with your Deis cluster: deis register http://ec2-34-567-890-123.us-west-1.compute.amazonaws.com:8000"

contrib/rackspace/initialize-rackspace-cluster.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ fi
2727

2828
cd $ROOT_DIR
2929

30-
# upload each component's systemd unit to the fleet cluster
31-
for component in registry logger database cache controller builder router
32-
do
33-
pushd $component/systemd > /dev/null
34-
fleetctl submit deis-$component.service
35-
fleetctl start deis-$component.service
36-
popd > /dev/null
30+
# upload all systemd unit to the fleet cluster
31+
units=()
32+
for component in builder cache controller database logger registry router; do
33+
units+=($component/systemd/*)
3734
done
3835

36+
fleetctl submit ${units[@]}
37+
fleetctl start ${units[@]}
38+
3939
echo_green "Done! Inspect the state of the services with: fleetctl list-units"
4040
echo_green "Once all the services are running, you can register with your Deis cluster: deis register 1.2.3.4:8000"

0 commit comments

Comments
 (0)