do not install bootstrap images directly anymore
[build.git] / onelab-install.mk
1 #
2 # Thierry Parmentelat - INRIA Sophia Antipolis 
3 #
4 ### $Id: onelab-install.mk 685 2007-07-19 09:01:41Z thierry $
5
6 # Installation rules
7
8
9 # make install :
10 #       uses $(PLCSSH) as an ssh address for the destination host
11 #       first copies everything on a separate rpm repo, prepares it, 
12 #       and then renames it into planetlab
13
14 # Upload packages to boot server
15
16 # use PLCHOST if set
17 ifdef PLCHOST
18 PLCSSH:=root@$(PLCHOST)
19 endif
20 # if nothing's defined : use this default
21 ifndef PLCSSH
22 PLCSSH          := root@private.one-lab.org
23 endif
24
25 RPMSAREA        := /var/www/html/install-rpms/
26
27 #BASE           := onelab
28 BASENEW         := build-$(notdir $(shell pwd))
29 BASEBAK         := planetlab-bak
30 BASE            := planetlab
31
32 ##########
33 # if make is invoked with -n, run rsync, but with --dry-run
34 RSYNC_COND_DRY_RUN      := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
35 RSYNC                   := rsync $(RSYNC_COND_DRY_RUN) 
36
37 INSTALL-TARGETS := install-rpms install-index install-adopt install-bootstrap
38 install: $(INSTALL-TARGETS)
39 .PHONY: install $(INSTALL-TARGETS)
40
41 install-help:
42         @echo install: $(INSTALL-TARGETS)
43
44 install-rpms:RPMS/yumgroups.xml
45         # create repository
46         ssh $(PLCSSH) mkdir -p /plc/data/$(RPMSAREA)/$(BASENEW)
47         # populate
48         +$(RSYNC) -v --perms --times --group --compress --rsh=ssh \
49            RPMS/yumgroups.xml $(wildcard RPMS/*/*.rpm) $(PLCSSH):/plc/data/$(RPMSAREA)/$(BASENEW)/
50
51 install-index:
52         # sign and index new repository
53         ssh $(PLCSSH) chroot /plc/root /etc/plc.d/packages start $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
54
55 install-clean-index:
56         # sign and index new repository
57         ssh $(PLCSSH) chroot /plc/root /etc/plc.d/packages clean $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
58
59 install-adopt:
60         # cleanup former bak
61         ssh $(PLCSSH) rm -rf /plc/data/$(RPMSAREA)/$(BASEBAK)
62         # bak previous repo
63         ssh $(PLCSSH) mv /plc/data/$(RPMSAREA)/$(BASE) /plc/data/$(RPMSAREA)/$(BASEBAK)
64         # install new repo
65         ssh $(PLCSSH) mv /plc/data/$(RPMSAREA)/$(BASENEW) /plc/data/$(RPMSAREA)/$(BASE)
66
67 install-bootstrap:
68         # install node image
69         ssh $(PLCSSH) chroot /plc/root yum -y update bootstrapfs
70
71