summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: cab9f8079ebbee5629a48ebb32f7abcd60b9da0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
all: deploy

tv-cluster := cd mkdir nomic rmdir wu
deploy-cd:; ./deploy cd
deploy-mkdir:; ./deploy mkdir
deploy-nomic:; ./deploy nomic root@nomic-local
deploy-rmdir:; ./deploy rmdir
deploy-wu:; ./deploy wu root@localhost

ifndef cluster
cluster := $(LOGNAME)
endif
hosts := $($(cluster)-cluster)
ifeq ($(hosts),)
$(error bad cluster: $(cluster))
else
.PHONY: deploy $(addprefix deploy-,$(hosts))
deploy:
	exec parallel \
		-j 0 \
		--no-notice \
		--rpl '{u} s/^.* deploy-(.*)/\1/' \
		--tagstring '{u}' \
		--line-buffer \
		$(MAKE) deploy-{} ::: $(hosts)
endif