summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: e58b9b0e65ed436be07588f0b544af70dca557a3 (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
27
28
29
30
31
32
33
34
HOSTS=nodes.txt
ALIVES=alive.txt
USER=irisaple_pacemaker2
SSH_CONFIG=ssh_config
OPTIONS=-x "-F $(SSH_CONFIG)"
FOPTIONS=$(OPTIONS) -h $(ALIVES)

.PHONY: alive deploy clean pink nuke

$(ALIVES) alive:
	pssh $(OPTIONS) -h $(HOSTS) "uname" -i | grep "\[SUCCESS\]"\
		| awk '{print $$4}' > $(ALIVES)

deploy_libs: requests simplejson

deploy_client: lastfm.py process.py

deploy_client deploy_libs: $(ALIVES)
	psshscp $(FOPTIONS) -r $(filter-out $(ALIVES), $+) /home/$(USER)
	touch $@

deploy: deploy_client deploy_libs

clean:
	pssh $(OPTIONS) -h $(HOSTS) "rm -f *.txt; rm -f *.out"

distclean:
	rm -f alive.txt deploy_client deploy_libs

ping: $(ALIVES)
	pssh $(FOPTIONS) "uname"

nuke:
	pnuke $(OPTIONS) -h $(HOSTS) "python"