summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2013-09-29 05:12:56 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2013-09-29 05:12:56 -0400
commit19346fa9068878af516cdb670bea4f791337507b (patch)
tree54d4fa5a82b2e0305f3b050dc1ebb53ec9d82a5d /Makefile
downloadlastfm-19346fa9068878af516cdb670bea4f791337507b.tar.gz
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e58b9b0
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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"