X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile;h=df16ab0f1aad05d6632f67815f99e76a072e330d;hb=ba1d00f91e94e9337c8c342fb9fc6b10b6ad17bb;hp=7cb8a6563e76946d207899f677796ef251d1152f;hpb=094a91004df52c1db9cbdd65abe8bff6dbccd99c;p=bootmanager.git diff --git a/Makefile b/Makefile index 7cb8a65..df16ab0 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,44 @@ -# -# $Id: Makefile 682 2007-07-19 09:00:25Z thierry $ # -########## make sync PLCHOST=hostname -########## make sync PLCHOST=hostname -ifdef PLCHOST -ifdef VSERVER -PLCSSH:=root@$(PLCHOST):/vservers/$(VSERVER) +########## sync +# 2 forms are supported +# (*) if your plc root context has direct ssh access: +# make sync PLC=private.one-lab.org +# (*) otherwise, entering through the root context +# make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr + +PLCHOST ?= testplc.onelab.eu + +ifdef GUEST +SSHURL:=root@$(PLCHOST):/vservers/$(GUEST) +SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST) exec endif +ifdef PLC +SSHURL:=root@$(PLC):/ +SSHCOMMAND:=ssh root@$(PLC) endif -LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude debug_root_ssh_key -RSYNC_EXCLUDES := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES) +LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' +RSYNC_EXCLUDES := --exclude .svn --exclude .git --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES) RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,) RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES) +DEPLOYMENT ?= regular + sync: -ifeq (,$(PLCSSH)) - echo "sync: You must define PLCHOST and VSERVER on the command line" - echo " e.g. make sync PLCHOST=private.one-lab.org VSERVER=myplc01" ; exit 1 +ifeq (,$(SSHURL)) + @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line" + @echo " e.g. make sync PLC=boot.planetlab.eu" + @echo " or make sync PLCHOST=testplc.onelab.eu GUEST=vplc03.inria.fr" + @exit 1 else - +$(RSYNC) source $(PLCSSH)/usr/share/bootmanager/ - ssh root@$(PLCHOST) vserver $(VSERVER) exec service plc start bootmanager + $(SSHCOMMAND) mkdir -p /usr/share/bootmanager/$(DEPLOYMENT) + +$(RSYNC) build.sh source $(SSHURL)/usr/share/bootmanager/$(DEPLOYMENT) + $(SSHCOMMAND) service plc start bootmanager endif ########## tags: - find . '(' -name '*.py' -o -name '*.spec' ')' | xargs etags + find . -type f | egrep -v 'TAGS|/\.svn/|\.git/|~$$' | xargs etags .PHONY: tags